Ejemplo n.º 1
0
    def add_endpoint(self, remote_ip, remote_port):
        remote_address = (remote_ip, int(remote_port))
        local_address = self._find_unused_local_port()

        new_endpoint = Endpoint(local_address, remote_address, self.transport)
        new_endpoint.enable()
        self.end_points[new_endpoint.getId()] = new_endpoint

        return new_endpoint.getId()