socketIO-client icon indicating copy to clipboard operation
socketIO-client copied to clipboard

Closing connections on EngineIO._close()

Open tcawlfield opened this issue 9 years ago • 2 comments

A socketIO connection can hold two connections open: its transport and its requests.Session instance. These should be closed in __del__() and __exit__().

I found that on a Linux system, failure to close the underlying websocket.WebSocket and requests.Session instances causes a file descriptor leak.

tcawlfield avatar Oct 05 '16 15:10 tcawlfield

I just experienced the same problem. It is easy to run out of TCP sockets with heavy usage because they are not actually being closed. I can confirm this pull request fixes the problem so it would be well worth merging it @invisibleroads 😉

Joe-Palmer avatar Jan 03 '17 15:01 Joe-Palmer

I can also verify that this PR fixes #176. @invisibleroads can we expect this fix soon. So, far after many tests I have not encountered any issues caused by this fix and connections closes alright.

ranjanagwl avatar Oct 01 '18 21:10 ranjanagwl