sta / sta/websocket-sharp

I get this error very frequentely: Frame cannot be read from the data source

Open
#71 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Several times a day if I have to close and reopen my application, I get this error and after that I have to completely restart my application in order to connect back in:

8/20/2014 1:18:09 PM|Fatal|WebSocket.processException|WebSocketSharp.WebSocketException: The header part of a frame cannot be read from the data source.
                             at WebSocketSharp.WebSocketFrame+<>c__DisplayClassd.<ParseAsync>b__c (System.Byte[] header) [0x00043] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocketFrame.cs:631 
                             at WebSocketSharp.Ext+<>c__DisplayClass6.<ReadBytesAsync>b__5 (IAsyncResult ar) [0x00056] in d:\Visual Studio 2010\Projects\websocket-sharp\Ext.cs:626

if I try to reconnect I get:

8/20/2014 1:18:10 PM|Fatal|WebSocket.processException|WebSocketSharp.WebSocketException: An exception has occurred while receiving a HTTP data. ---> System.ArgumentOutOfRangeException: Argument is out of range.
                           Parameter name: value
                             at WebSocketSharp.Ext.EqualsWith (Int32 value, Char c, System.Action`1 action) [0x00032] in d:\Visual Studio 2010\Projects\websocket-sharp\Ext.cs:445 
                             at WebSocketSharp.WebSocketStream.readHeaders (System.IO.Stream stream, Int32 maxLength) [0x0002b] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocketStream.cs:115 
                             at WebSocketSharp.WebSocketStream.readHttp[HttpResponse] (System.IO.Stream stream, System.Func`2 parser, Int32 millisecondsTimeout) [0x00039] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocketStream.cs:151 
                             --- End of inner exception stack trace ---
                             at WebSocketSharp.WebSocketStream.readHttp[HttpResponse] (System.IO.Stream stream, System.Func`2 parser, Int32 millisecondsTimeout) [0x000f5] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocketStream.cs:174 
                             at WebSocketSharp.WebSocketStream.sendHttpRequest (System.IO.Stream stream, WebSocketSharp.HttpRequest request, Int32 millisecondsTimeout) [0x00014] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocketStream.cs:182 
                             at WebSocketSharp.WebSocketStream.SendHttpRequest (WebSocketSharp.HttpRequest request, Int32 millisecondsTimeout) [0x00001] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocketStream.cs:294 
                             at WebSocketSharp.WebSocket.sendHandshakeRequest (WebSocketSharp.HttpRequest request, Int32 millisecondsTimeout) [0x00020] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocket.cs:1297 
                             at WebSocketSharp.WebSocket.sendHandshakeRequest () [0x00008] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocket.cs:1268 
                             at WebSocketSharp.WebSocket.doHandshake () [0x00008] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocket.cs:906 
                             at WebSocketSharp.WebSocket.connect () [0x0004a] in d:\Visual Studio 2010\Projects\websocket-sharp\WebSocket.cs:797 

And thanks a lot for the awesome project.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WebSocketFrame.cs:631 and trace the asynchronous read through Ext.cs:626. Then inspect WebSocketStream.cs:115-182 and WebSocket.cs:797-1297 for the reconnect sequence. Reproduce closing and reopening the application, and consider the issue resolved when reconnecting no longer produces the frame-read or HTTP-header exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.