Multiconnection server can't handle Connection Reset events
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
Start with server.py, especially service_connection at line 24 and the event-loop call at line 65. Reproduce the issue by closing the Windows client connection, then verify that the server handles the reset and continues serving other connections instead of exiting with ConnectionResetError.
Written by the indexing model from the issue text.
Description
It seems the Muli-connection server example doesn't properly handle the Connection Reset Error;
Traceback (most recent call last):
File "server.py", line 65, in <module>
service_connection(key, mask)
File "server.py", line 24, in service_connection
recv_data = sock.recv(1024) # Should be ready to read
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
This error occurs when, for example, the Windows Command Prompt running the client.py (connected to the server) is closed. In this case, a peer reset is sent to the server, but since the server can't handle it, it simply exits with the above error.
Is there any specific event to catch this error and avoid breaking the server?
Thanks
SS
- Dominant language
- Jupyter Notebook
- Stars
- 5.2k
- Forks
- 5.3k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 10
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.
More from realpython/materials
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
realpython/materials#729 ·
-
п Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
realpython/materials#763 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
realpython/materials#738 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
realpython/materials#737 ·
-
проект2 Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
realpython/materials#725 ·
All issues in realpython/materials
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
canonical/postgresql-watcher-operator#110 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EleutherAI/lm-evaluation-harness#4201 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
possible bug Stage1
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PrismarineJS/mineflayer#4147 ·