danpaquin / coinbasepro-python

The unofficial Python client for the Coinbase Pro API
MIT License
1.82k stars 738 forks source link

[Errno 54] Connection reset by peer - data: .... #342

Closed koen430 closed 5 years ago

koen430 commented 5 years ago

After some time of running the WebSocket the error [Errno 54] Connection reset by a peer occurs. This happens after some random amount of time, sometimes within a day, sometimes after a couple of days. I tried to fix this by changing the on_error function to: def on_error(self, e, data=None): print('{} - data: {}'.format(e, data)) self.error = e self.stop = True self.thread.join() self.start() to have it close the connection after an error occurs and restart the connection. This however gives me another error, RuntimeError: cannot join current thread. Is there a way to solve this problem?