1
0

follow-up prev: make best_effort_reliable react faster to disconnects

This commit is contained in:
SomberNight
2018-09-27 20:04:36 +02:00
parent 6b8ad2d126
commit 4984890265
2 changed files with 11 additions and 8 deletions

View File

@@ -132,6 +132,7 @@ class Interface(PrintError):
def __init__(self, network, server, config_path, proxy):
self.exception = None
self.ready = asyncio.Future()
self.got_disconnected = asyncio.Future()
self.server = server
self.host, self.port, self.protocol = deserialize_server(self.server)
self.port = int(self.port)
@@ -246,6 +247,7 @@ class Interface(PrintError):
self.print_error("disconnecting gracefully. {}".format(e))
finally:
await self.network.connection_down(self.server)
self.got_disconnected.set_result(1)
return wrapper_func
@aiosafe