py-libp2p/transport/listener_interface.py
ZX 8bcffb67cb WIP CI Build Errors (#76)
* ignore TODO and kademlia

* remove unnecessary pass

* fixed swarm warnings

* fixed peerdata_interface warnings

* fixed peer warnings

* fixed rest of linting errors

* trying to fix last error

* fixed dup errors
2018-11-26 18:24:29 -05:00

30 lines
829 B
Python

from abc import ABC, abstractmethod
class IListener(ABC):
@abstractmethod
def listen(self, multiaddr):
"""
put listener in listening mode and wait for incoming connections
:param multiaddr: multiaddr of peer
:return: return True if successful
"""
@abstractmethod
def get_addrs(self):
"""
retrieve list of addresses the listener is listening on
:return: return list of addrs
"""
@abstractmethod
def close(self, options=None):
"""
close the listener such that no more connections
can be open on this transport instance
:param options: optional object potential with timeout
a timeout value in ms that fires and destroy all connections
:return: return True if successful
"""