Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocketMessageReadNetworkStream can only start with a Text or Binary frame, not Continuation #135

Open
imanushin opened this issue Aug 22, 2018 · 2 comments

Comments

@imanushin
Copy link

In case of working with Java Spring 5.0 Web Sockets, the following error was occurred:

WebSocketMessageReadNetworkStream can only start with a Text or Binary frame, not Continuation.

How this can be fixed?

This issue happens on the massive web socket messages receive, e.g. it is actual only for case, when multiple independent parallel connections (for the same socket client) receive ~10 000 messages.

@vtortola
Copy link
Owner

Hi,

It seems it is trying to read a message when an existing one is still being transferred. How long are the messages usually? Are you making sure the message is completely read (ie: the message stream is fully consumed). I am not very sure how this may happen. The size of the message when fails could be a good hint.

Cheers.

throw new WebSocketException("WebSocketMessageReadNetworkStream can only start with a Text or Binary frame, not " + _webSocket.CurrentHeader.Flags.Option.ToString());

@imanushin
Copy link
Author

I think I understand, what was happened. I checked message type firstly, then I copied message entirely to the separate memory stream. I will replace order of these functions.

About the probability: 1 timer per 10 000 messages (average)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants