Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(async): handle close of packet stream to avoid panic
When the packet stream closes, e.g. because the server terminated the connection, the stream returns None. Then, the next() function shouldn't be called again on the stream, as it is already closed. Previously, we wouldn't handle this, which lead to a panic. Before the fix which implemented the as_stream() function for the socket, the program wouldn't panic, but instead run in an endless loop which isn't ideal either. Now, the loop which fetches the packets from the stream properly terminates. However, the program which uses the socket.io client currently isn't notified of the unexpected closure.
- Loading branch information