mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
bpo-27456: Simplify sock type checks (#4922)
Recent sock.type fix (see bug 32331) makes sock.type checks simpler in asyncio.
This commit is contained in:
parent
5d8624647d
commit
a7bd64c0c0
3 changed files with 9 additions and 29 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
|
||||
base_events._is_stream_socket(sock.type) and
|
||||
sock.type == socket.SOCK_STREAM 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