mirror of
https://github.com/solero/houdini.git
synced 2024-11-21 21:17:21 +00:00
Move peer connection status check into _client_disconnected
This commit is contained in:
parent
d9fd35249b
commit
28b1cc7937
@ -146,10 +146,11 @@ class Spheniscidae:
|
|||||||
await self.server.dummy_event_listeners.fire('connected', self)
|
await self.server.dummy_event_listeners.fire('connected', self)
|
||||||
|
|
||||||
async def _client_disconnected(self):
|
async def _client_disconnected(self):
|
||||||
del self.server.peers_by_ip[self.peer_name]
|
if self.peer_name in self.server.peers_by_ip:
|
||||||
self.logger.info(f'Client {self.peer_name} disconnected')
|
del self.server.peers_by_ip[self.peer_name]
|
||||||
|
self.logger.info(f'Client {self.peer_name} disconnected')
|
||||||
|
|
||||||
await self.server.dummy_event_listeners.fire('disconnected', self)
|
await self.server.dummy_event_listeners.fire('disconnected', self)
|
||||||
|
|
||||||
async def __data_received(self, data):
|
async def __data_received(self, data):
|
||||||
data = data.decode()[:-1]
|
data = data.decode()[:-1]
|
||||||
@ -183,8 +184,7 @@ class Spheniscidae:
|
|||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.logger.exception(e.__traceback__)
|
self.logger.exception(e.__traceback__)
|
||||||
|
|
||||||
if self.peer_name in self.server.peers_by_ip:
|
await self._client_disconnected()
|
||||||
await self._client_disconnected()
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'<Spheniscidae {self.peer_name}>'
|
return f'<Spheniscidae {self.peer_name}>'
|
||||||
|
Loading…
Reference in New Issue
Block a user