Skip to content

Commit

Permalink
Merge 4ed97bb into 53c58d3
Browse files Browse the repository at this point in the history
  • Loading branch information
liampauling committed May 26, 2019
2 parents 53c58d3 + 4ed97bb commit 0af6ad2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions betfairlightweight/streaming/betfairstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ def _receive_all(self):

# an empty string indicates the server shutdown the socket
if len(part) == 0:
self.stop()
raise SocketError('Connection closed by server')
if self._running:
self.stop()
raise SocketError('[Connect: %s]: Connection closed by server' % (self._unique_id,))
else:
return # 165, prevents error if stop is called mid recv

data += part.decode(self.__encoding)
return data
Expand Down

0 comments on commit 0af6ad2

Please sign in to comment.