

@handler('connect', channel='source')
def _on_source_connect(self, sock, host, port):
    'Explicitly defined connect Event Handler\n\n        This evens is triggered by the underlying TCPServer Component when\n        a new client connection has been made.\n\n        Here we dynamically create a Client instance, registere it and add\n        custom event handlers to handle the events of the newly created\n        client. The client is registered with a unique channel per connection.\n        '
    bind = 0
    channel = uuid()
    client = TCPClient(bind, channel=channel)
    client.register(self)
    self.addHandler(handler('disconnected', channel=channel)(_on_target_disconnected))
    self.addHandler(handler('ready', channel=channel)(_on_target_ready))
    self.addHandler(handler('read', channel=channel)(_on_target_read))
    host._clients[sock] = client
    self._sockets[client.channel] = sock

dataset/ETHPy150Open circuits/circuits/examples/portforward.py PortForwarder._on_source_connect/VarMisuse@107/271 `self`->`host`