mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231)
This commit is contained in:
parent
4ac5150e06
commit
e796b2fe26
6 changed files with 53 additions and 31 deletions
|
@ -41,7 +41,7 @@ def _test_selector_event(selector, fd, event):
|
|||
if hasattr(socket, 'TCP_NODELAY'):
|
||||
def _set_nodelay(sock):
|
||||
if (sock.family in {socket.AF_INET, socket.AF_INET6} and
|
||||
sock.type == socket.SOCK_STREAM and
|
||||
base_events._is_stream_socket(sock.type) and
|
||||
sock.proto == socket.IPPROTO_TCP):
|
||||
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue