sta / websocket-sharp

A C# implementation of the WebSocket protocol client and server
http://sta.github.io/websocket-sharp
MIT License
5.68k stars 1.66k forks source link

The header of a frame cannot be read from the stream [Error] #593

Open FrenziedIM opened 4 years ago

FrenziedIM commented 4 years ago

Anyone else ever experienced this error?

09/02/2020 15:49:15|Fatal|WebSocket.<startReceiving>b__179_2:0|WebSocketSharp.WebSocketException: The header of a frame cannot be read from the stream.
                             at WebSocketSharp.WebSocketFrame.processHeader(Byte[] header)
                             at WebSocketSharp.WebSocketFrame.<>c__DisplayClass73_0.<readHeaderAsync>b__0(Byte[] bytes)
                             at WebSocketSharp.Ext.<>c__DisplayClass55_0.<ReadBytesAsync>b__0(IAsyncResult ar)

I don't know how to fix it, I've tried googling with no avail.

Thanks!

eynzhang commented 4 years ago

@GramCreator can you reproduce this issue?

I get this error when my WebSocket client close the connection.

FrenziedIM commented 4 years ago

@GramCreator can you reproduce this issue?

I get this error when my WebSocket client close the connection.

I just connect to the WebSocket via URL, host & origin + others headers.

It DOES however work on Chrome. Both with: https://www.websocket.org/echo.html and with the Browser WebSocket Client extension. They both work to connect and saend/receive messages without an issue.

sergey-dudik commented 4 years ago

I have the same problem. Win 10, .Net 4.7.2. Server is Java / Spring boot.