-
Notifications
You must be signed in to change notification settings - Fork 85
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
Large messages issue #47
Comments
I will take a look in the next few days. The default value for the ping interval is 5 seconds, could you try to disable the ping setting Timeout.InfiniteTimespan and try again? I maybe the problem is because WSL is sending a ping frame interpolated with data frames if the data is very large (totally legal according to the specification). Thanks for taking time in making the reproducible case and reporting it 👍 |
Thanks @vtortola, it turns out to be an issue with the WebSocket4Net library not treating injected control frames in the middle of a fragmented message as specified in the protocol. Thanks for leading me to the right direction. 👍 |
No problem :) I just saw your pull request to WebSocket4Net, nice 👍 Playing with your example code I also found that This will work: Task.Run(async () =>
{
var writeBuffer = new ArraySegment<byte>(Encoding.UTF8.GetBytes(String.Join("", Enumerable.Range(0, 16376).Select(i => "a"))));
while (!_cancel.IsCancellationRequested)
{
await ws.SendAsync(writeBuffer, System.Net.WebSockets.WebSocketMessageType.Text, true, CancellationToken.None);
await Task.Delay(10).ConfigureAwait(false);
}
}); Now changing the length of the payload from |
Hi,
I've been told that WampSharp has issues with the vtrotola WebSocketListener transport and large messages.
After investigating this, this seems to be an issue that looks like a race condition in WebSocketListener. I'm attaching some code that reproduces this. Note that not every run results with an exception, so it seems this is really some kind of race condition.
See the code here. You need to install vtortola.WebSocketListener, WebSocket4Net and Newtonsoft.Json. The application should crash at some point with this exception:
Investigating the received message, we see a substring of the sent JSON ending with this suffix "i��y2���".
You might suspect that this may be a problem related to WebSocket4Net, but it works fine with other WebSocket libraries such as Fleck.
Any help is appreciated,
Thanks!
Elad
The text was updated successfully, but these errors were encountered: