This exception occurs when the connection is dropped unexpectedly, it isn’t that PhantomBot lost the connection. This is an expected exception in certain conditions – I’ve triggered it at times closing my web browser. It tries to send data, but there is nowhere to send it to. I can bury the exception I suppose or print out something different, but, honestly, I’m working on getting rid of that websocket server and moving over to a simpler implementation - been testing it for a while now.
You can try out, in the Nightly, a different websocket server implementation by placing the following into botlogin.txt:
From what I can tell on my VPS, it seems to be faster, but that could be my imagination as I haven’t officially timed it. The following are but a few reasons I am looking to move to this:
- The SSL issues with the current websocket server implementation. I’ve hacked in a few fixes, but people still seem to have issues.
- Simplicity. This newer code is a bit more compact. It was missing a lot of error handling, but I added that in.
- Cleaner. The newer code is cleaner and it is easier to determine the object functionality.