fix client loop closing
This commit is contained in:
@@ -391,18 +391,18 @@ class AsyncStreamClient(AsyncStream):
|
|||||||
'Client loop stopped for'
|
'Client loop stopped for'
|
||||||
f' l{self.l_addr}')
|
f' l{self.l_addr}')
|
||||||
|
|
||||||
server_stream = self.remote.stream
|
server_ifc = self.remote.ifc
|
||||||
|
|
||||||
# if the client connection closes, we don't touch the server
|
# if the client connection closes, we don't touch the server
|
||||||
# connection. Instead we erase the client connection stream,
|
# connection. Instead we erase the client connection stream,
|
||||||
# thus on the next received packet from the inverter, we can
|
# thus on the next received packet from the inverter, we can
|
||||||
# establish a new connection to the TSUN cloud
|
# establish a new connection to the TSUN cloud
|
||||||
|
|
||||||
if server_stream.remote.ifc == self:
|
if server_ifc.remote.ifc == self:
|
||||||
# logging.debug(f'Client l{client_stream.l_addr} refs:'
|
# logging.debug(f'Client l{client_stream.l_addr} refs:'
|
||||||
# f' {gc.get_referrers(client_stream)}')
|
# f' {gc.get_referrers(client_stream)}')
|
||||||
# than erase client connection
|
# than erase client connection
|
||||||
server_stream.remote.stream = None # erases stream and ifc link
|
server_ifc.remote.stream = None # erases stream and ifc link
|
||||||
|
|
||||||
# erase backlink to inverter
|
# erase backlink to inverter
|
||||||
self.remote.stream = None
|
self.remote.stream = None
|
||||||
|
|||||||
Reference in New Issue
Block a user