refactor: Use SHSDuplexStream.close instead of disconnect

`disconnect()` is now deprecated to make the API more consistent.
This commit is contained in:
Gergely Polonkai 2023-11-13 13:14:25 +01:00
parent c2fffafa4e
commit 59c99097a2
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -229,7 +229,7 @@ class PacketStream:
if not read_data: if not read_data:
logger.debug("DISCONNECT") logger.debug("DISCONNECT")
self.connection.disconnect() self.connection.close()
return None return None
@ -240,7 +240,8 @@ class PacketStream:
return PSMessage.from_header_body(flags, req, body) return PSMessage.from_header_body(flags, req, body)
except StopAsyncIteration: except StopAsyncIteration:
logger.debug("DISCONNECT") logger.debug("DISCONNECT")
self.connection.disconnect() self.connection.close()
return None return None
async def read(self) -> Optional[PSMessage]: async def read(self) -> Optional[PSMessage]:
@ -314,4 +315,4 @@ class PacketStream:
"""Disconnect the stream""" """Disconnect the stream"""
self._connected = False self._connected = False
self.connection.disconnect() self.connection.close()