py-libp2p/libp2p/transport/listener_interface.py
mhchia a7ce230d05
Change params multiaddr to maddr
To make pylint happy
2019-07-10 19:33:38 +08:00

30 lines
821 B
Python

from abc import ABC, abstractmethod
class IListener(ABC):
@abstractmethod
def listen(self, maddr):
"""
put listener in listening mode and wait for incoming connections
:param maddr: 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
"""