You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue here is that when the client finishes writing, the server receives that message correctly, but then the client connection "closes" (i.e. the WebSockets.open call finishes) and a CLOSE frame is sent to the server. These "control" frames are not meant to be user-facing, but are more internal to the state of the websocket connection. Unfortunately, the old websockets code would return a CLOSE frame as an empty message to the user.
I just merged an overhaul of the websockets code and this is now more correct in that CLOSE frames are not returned directly to the user as messages, so we get this behavior now:
Thank you very much for an answer and a fix! I spent some time looking at the sources, but being new to streams, async, and websockets, I was just scratching my head...
I am learning about streams and WebSockets and I can't figure out why the
!eof
in the following example runs the body of the loop twice:I see this by running:
Which prints:
I am having trouble replicating this behavior with other kinds of streams:
I ran into this when getting cryptic messages while trying to parse the empty values as json and getting cryptic error messages.
Versions:
The text was updated successfully, but these errors were encountered: