8000 gh-112020: socketserver: Add an example for keeping the connection open by talcs · Pull Request #112054 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112020: socketserver: Add an example for keeping the connection open #112054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
whitespace
  • Loading branch information
AA-Turner authored Jan 12, 2024
commit 8028b11669074a8a6b4fecbe5d50208eef25dd95
4 changes: 2 additions & 2 deletions Doc/library/socketserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ The difference is that the ``readline()`` call in the second handler will call
single ``recv()`` call in the first handler will just return what has been sent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the line above add "or ``recv()`` returns an empty bytes object" after "until it encounters a newline character"

from the client in one ``sendall()`` call.

The handlers presented above close the connection after handling a single request.
It is possible, however, to keep the connection open to handle many requests,
The handlers presented above close the connection after handling a single request.
It is possible, however, to keep the connection open to handle many requests,
until the client hangs up::

class MyTCPHandler(socketserver.BaseRequestHandler):
Expand Down
0