Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only send data if the socket is open (#75)
Sometimes the read promise resolves without error, but the socket is in the `CLOSING` state. This causes an error to be thrown so only send data if the socket is `OPEN` - if it's `CLOSING` treat it as `CLOSED` and exit the loop.
- Loading branch information
f63265e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
f63265e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achingbrain there is also a callback method on
socket.send
that we could use that has an error object