Unhandled Exception Crash in onAccept in EndPointListener
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
There is an unhandled exception problem in EndPointListener in onAccept on the line:
sock = lsnr._socket.EndAccept (asyncResult);
The type of exception is System.Net.Sockets.SocketException the NativeErrorCode is 10054 and the Message is An existing connection was forcibly closed by the remote host
This seems to happen if the connection is closed before it really started. See also:
http://stackoverflow.com/questions/7704417/socket-endaccept-error-10054
The current code only handles the ObjectDisposedException but should also handle at least the SocketException and make sure that listening for other incoming connections continues. See https://msdn.microsoft.com/en-us/library/chfa7866(v=vs.110).aspx for list of exceptions that should probably be handled.
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
Start at EndPointListener.onAccept, specifically the EndAccept call shown in the report, and review how ObjectDisposedException is currently handled. Verify that a SocketException with native error 10054 does not terminate acceptance of subsequent connections; done means the listener continues handling new incoming connections after the closed connection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100