Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Multiconnection server can't handle Connection Reset events

Open
#210 0 comments 0 reactions 0 assignees View on GitHub

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

  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 realpython/materials

All issues in realpython/materials

Similar issues

More Networking issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.