diff --git a/steam/core/connection.py b/steam/core/connection.py index ecf75d92..277a1dd8 100644 --- a/steam/core/connection.py +++ b/steam/core/connection.py @@ -176,6 +176,7 @@ def __init__(self): self.ws = WSConnection(ConnectionType.CLIENT) self.ssl_ctx = ssl.create_default_context(cafile=certifi.where()) self.event_wsdisconnected = event.Event() + self._readbuf = b'' def _new_socket(self): self.raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -232,7 +233,9 @@ def _reader_loop(self): return logger.debug("Received {} bytes".format(len(data))) - self.ws.receive_data(data) + self._readbuf += data + self.ws.receive_data(self._readbuf) + self._readbuf = b'' self._handle_events() def _handle_events(self):