forked from p15670423/monkey
Agent: Simplify relay disconnect logic in network/relay/utils.py
This commit is contained in:
parent
441c14f15d
commit
d1199fdab2
|
@ -79,18 +79,15 @@ def _check_if_island_server(
|
||||||
|
|
||||||
def send_remove_from_waitlist_control_message_to_relays(servers: Iterable[str]):
|
def send_remove_from_waitlist_control_message_to_relays(servers: Iterable[str]):
|
||||||
for i, server in enumerate(servers, start=1):
|
for i, server in enumerate(servers, start=1):
|
||||||
|
server_address = SocketAddress.from_string(server)
|
||||||
t = create_daemon_thread(
|
t = create_daemon_thread(
|
||||||
target=_send_remove_from_waitlist_control_message_to_relay,
|
target=notify_disconnect,
|
||||||
name=f"SendRemoveFromWaitlistControlMessageToRelaysThread-{i:02d}",
|
name=f"SendRemoveFromWaitlistControlMessageToRelaysThread-{i:02d}",
|
||||||
args=(server,),
|
args=(server_address,),
|
||||||
)
|
)
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
|
|
||||||
def _send_remove_from_waitlist_control_message_to_relay(server: str):
|
|
||||||
notify_disconnect(SocketAddress.from_string(server))
|
|
||||||
|
|
||||||
|
|
||||||
def notify_disconnect(server_address: SocketAddress):
|
def notify_disconnect(server_address: SocketAddress):
|
||||||
"""
|
"""
|
||||||
Tell upstream relay that we no longer need the relay
|
Tell upstream relay that we no longer need the relay
|
||||||
|
|
Loading…
Reference in New Issue