forked from p15670423/monkey
Agent: Add docstrings to RelayConnectionHandler
This commit is contained in:
parent
efac1dae98
commit
7ebc403029
|
@ -8,11 +8,18 @@ RELAY_CONTROL_MESSAGE = b"infection-monkey-relay-control-message: -"
|
|||
|
||||
|
||||
class RelayConnectionHandler:
|
||||
"""Handles new relay connections."""
|
||||
|
||||
def __init__(self, pipe_spawner: TCPPipeSpawner, relay_user_handler: RelayUserHandler):
|
||||
self._pipe_spawner = pipe_spawner
|
||||
self._relay_user_handler = relay_user_handler
|
||||
|
||||
def handle_new_connection(self, sock: socket.socket):
|
||||
"""
|
||||
Spawn a new pipe, or remove the user if the user requested to disconnect.
|
||||
|
||||
:param sock: The socket for the new connection.
|
||||
"""
|
||||
addr, _ = sock.getpeername()
|
||||
addr = IPv4Address(addr)
|
||||
|
||||
|
|
Loading…
Reference in New Issue