Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
503ba3ed
Commit
503ba3ed
authored
Sep 11, 2016
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.5 (issue #27456)
parents
2609fa73
44c19ecc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
Lib/asyncio/selector_events.py
Lib/asyncio/selector_events.py
+16
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/asyncio/selector_events.py
View file @
503ba3ed
...
@@ -39,6 +39,17 @@ def _test_selector_event(selector, fd, event):
...
@@ -39,6 +39,17 @@ def _test_selector_event(selector, fd, event):
return
bool
(
key
.
events
&
event
)
return
bool
(
key
.
events
&
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
sock
.
proto
==
socket
.
IPPROTO_TCP
):
sock
.
setsockopt
(
socket
.
IPPROTO_TCP
,
socket
.
TCP_NODELAY
,
1
)
else
:
def
_set_nodelay
(
sock
):
pass
class
BaseSelectorEventLoop
(
base_events
.
BaseEventLoop
):
class
BaseSelectorEventLoop
(
base_events
.
BaseEventLoop
):
"""Selector event loop.
"""Selector event loop.
...
@@ -641,6 +652,11 @@ class _SelectorSocketTransport(_SelectorTransport):
...
@@ -641,6 +652,11 @@ class _SelectorSocketTransport(_SelectorTransport):
self
.
_eof
=
False
self
.
_eof
=
False
self
.
_paused
=
False
self
.
_paused
=
False
# Disable the Nagle algorithm -- small writes will be
# sent without waiting for the TCP ACK. This generally
# decreases the latency (in some cases significantly.)
_set_nodelay
(
self
.
_sock
)
self
.
_loop
.
call_soon
(
self
.
_protocol
.
connection_made
,
self
)
self
.
_loop
.
call_soon
(
self
.
_protocol
.
connection_made
,
self
)
# only start reading when connection_made() has been called
# only start reading when connection_made() has been called
self
.
_loop
.
call_soon
(
self
.
_loop
.
add_reader
,
self
.
_loop
.
call_soon
(
self
.
_loop
.
add_reader
,
...
...
Misc/NEWS
View file @
503ba3ed
...
@@ -365,6 +365,8 @@ Library
...
@@ -365,6 +365,8 @@ Library
-
asyncio
:
Add
set_protocol
/
get_protocol
to
Transports
.
-
asyncio
:
Add
set_protocol
/
get_protocol
to
Transports
.
-
Issue
#
27456
:
asyncio
:
Set
TCP_NODELAY
by
default
.
IDLE
IDLE
----
----
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment