bpo-27456: Ensure TCP_NODELAY is set on linux (#4231)

This commit is contained in:
Yury Selivanov 2017-12-15 19:32:25 -05:00 committed by GitHub
parent 4ac5150e06
commit e796b2fe26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 31 deletions

View file

@ -222,7 +222,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
if sock is None:
raise ValueError('no path and sock were specified')
if (sock.family != socket.AF_UNIX or
not base_events._is_stream_socket(sock)):
not base_events._is_stream_socket(sock.type)):
raise ValueError(
f'A UNIX Domain Stream Socket was expected, got {sock!r}')
sock.setblocking(False)
@ -276,7 +276,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
'path was not specified, and no sock specified')
if (sock.family != socket.AF_UNIX or
not base_events._is_stream_socket(sock)):
not base_events._is_stream_socket(sock.type)):
raise ValueError(
f'A UNIX Domain Stream Socket was expected, got {sock!r}')