Repeat visitor here, and apologies for what must be a very unclear question/report/thing.
If you try to do almost anything with a BinaryJS stream (on the node.js server side) after the WebSocket connection is closed, the operation will throw an exception from within streamws because readyState is not OPEN. It's not clear how this can be avoided in my code, except by checking $binaryclient._socket.readyState manually, or by wrapping all operations in try/catch. In particular:
Taking a look at all these issues now
Ok I added a check that the socket is open before doing any writes on streams, returning false if socket is closed (which should cause a stream to stop) this should address 1. and 2.
Ok this also partially addresses 3. because now when you write it won't throw but the .write will return false.
The close event indeed doesn't fire immediately but it does soon thereafter.
Let me know if this is acceptable solution. Feel free to reopen
Will be pushed in 0.1.8