Agent: Allow callback registration on TCPConnectionHandler

This commit is contained in:
Kekoa Kaaikala 2022-09-01 19:19:05 +00:00
parent ef39a8afd1
commit b1c1d2bd39
1 changed files with 8 additions and 0 deletions

View File

@ -41,3 +41,11 @@ class TCPConnectionHandler(Thread):
def stop(self):
self._stopped = True
def notify_client_connected(self, callback: Callable[[socket.socket, IPv4Address], None]):
"""
Register to be notified when a client connects.
:param callback: Callable used to notify when a client connects.
"""
self._client_connected = callback