Non-fatal socket exceptions in WebSocketserver
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
In the receive loop in receiveRequest, it is possible that the AcceptTcpClient call will cause a SocketException to be thrown which is non-fatal.
Specifically, WSAEMFILE: Too many open files, or WSAENOBUFS: No buffer space available.
Both of these are non-fatal errors. They should not result in the WebSocketServer shutting down.
It is easy to have the receiveRequest loop recognize these errors, and simply wait and then retry the AcceptTcpClient, which is the recommended approach.
However, it seems like there should be a mechanism to notify the program that this has occurred without affecting the state of the WebSocketServer. Perhaps an event?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the WebSocketServer receiveRequest loop and inspect how AcceptTcpClient SocketException failures currently affect shutdown. Confirm the handling for WSAEMFILE and WSAENOBUFS, then determine how a retry and non-shutdown notification should fit the existing server API; done means these errors no longer stop the server and the occurrence can be reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100