ArgumentOutOfRangeException on connection

Open
#205 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start with Ext.EqualsWith and HttpBase.readHeaders, following the stack trace through HttpBase.Read and TcpListenerWebSocketContext. Reproduce the failure with roughly 30 connected clients and the reported connection scenario. Done means identifying the out-of-range input, preventing the exception, and confirming the connection path remains stable.

Written by the indexing model from the issue text.

Description

When using WebSocketSharp 1.0.3-rc6, with about 30 clients connected I've sometimes seen this exception get thrown. Possibly it's been fixed since then (I'm about to try rc10), but this is an FYI in case:

WebSocketSharp.WebSocketException: An exception has occurred while reading an HTTP request/response. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value
   at WebSocketSharp.Ext.EqualsWith(Int32 value, Char c, Action`1 action)
   at WebSocketSharp.HttpBase.readHeaders(Stream stream, Int32 maxLength)
   at WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout)
   --- End of inner exception stack trace ---
   at WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout)
   at WebSocketSharp.HttpRequest.Read(Stream stream, Int32 millisecondsTimeout)
   at WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext..ctor(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger logger)
   at WebSocketSharp.Ext.GetWebSocketContext(TcpClient tcpClient, String protocol, Boolean secure, ServerSslConfiguration sslConfig, Logger logger)
   at WebSocketSharp.Server.WebSocketServer.<>c__DisplayClass6.<receiveRequest>b__5(Object state)
Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

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.

More from sta/websocket-sharp

All issues in sta/websocket-sharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.