Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
bff1a14a
Commit
bff1a14a
authored
Jul 07, 2016
by
Jim Fulton
Committed by
GitHub
Jul 07, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #37 from zopefoundation/TCP_NODELAY
TCP_NODELAY
parents
1eb086da
a0fa2fe7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
src/ZEO/asyncio/base.py
src/ZEO/asyncio/base.py
+12
-0
src/ZEO/asyncio/testing.py
src/ZEO/asyncio/testing.py
+1
-1
src/ZEO/tests/InvalidationTests.py
src/ZEO/tests/InvalidationTests.py
+2
-2
No files found.
src/ZEO/asyncio/base.py
View file @
bff1a14a
from
struct
import
unpack
from
struct
import
unpack
import
asyncio
import
asyncio
import
logging
import
logging
import
socket
import
sys
from
.marshal
import
encoder
from
.marshal
import
encoder
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
INET_FAMILIES
=
socket
.
AF_INET
,
socket
.
AF_INET6
class
Protocol
(
asyncio
.
Protocol
):
class
Protocol
(
asyncio
.
Protocol
):
"""asyncio low-level ZEO base interface
"""asyncio low-level ZEO base interface
"""
"""
...
@@ -41,7 +45,15 @@ class Protocol(asyncio.Protocol):
...
@@ -41,7 +45,15 @@ class Protocol(asyncio.Protocol):
def
connection_made
(
self
,
transport
):
def
connection_made
(
self
,
transport
):
logger
.
info
(
"Connected %s"
,
self
)
logger
.
info
(
"Connected %s"
,
self
)
if
sys
.
version_info
<
(
3
,
6
):
sock
=
transport
.
get_extra_info
(
'socket'
)
if
sock
is
not
None
and
sock
.
family
in
INET_FAMILIES
:
# See https://bugs.python.org/issue27456 :(
sock
.
setsockopt
(
socket
.
IPPROTO_TCP
,
socket
.
TCP_NODELAY
,
True
)
self
.
transport
=
transport
self
.
transport
=
transport
paused
=
self
.
paused
paused
=
self
.
paused
output
=
self
.
output
output
=
self
.
output
append
=
output
.
append
append
=
output
.
append
...
...
src/ZEO/asyncio/testing.py
View file @
bff1a14a
...
@@ -86,7 +86,7 @@ class Transport:
...
@@ -86,7 +86,7 @@ class Transport:
capacity
=
1
<<
64
capacity
=
1
<<
64
paused
=
False
paused
=
False
extra
=
dict
(
peername
=
'1.2.3.4'
,
sockname
=
(
'127.0.0.1'
,
4200
))
extra
=
dict
(
peername
=
'1.2.3.4'
,
sockname
=
(
'127.0.0.1'
,
4200
)
,
socket
=
None
)
def
__init__
(
self
,
protocol
):
def
__init__
(
self
,
protocol
):
self
.
data
=
[]
self
.
data
=
[]
...
...
src/ZEO/tests/InvalidationTests.py
View file @
bff1a14a
...
@@ -324,8 +324,8 @@ class InvalidationTests:
...
@@ -324,8 +324,8 @@ class InvalidationTests:
def
checkConcurrentUpdates2Storages_emulated
(
self
):
def
checkConcurrentUpdates2Storages_emulated
(
self
):
self
.
_storage
=
storage1
=
self
.
openClientStorage
()
self
.
_storage
=
storage1
=
self
.
openClientStorage
()
storage2
=
self
.
openClientStorage
()
db1
=
DB
(
storage1
)
db1
=
DB
(
storage1
)
storage2
=
self
.
openClientStorage
()
db2
=
DB
(
storage2
)
db2
=
DB
(
storage2
)
cn
=
db1
.
open
()
cn
=
db1
.
open
()
...
@@ -349,8 +349,8 @@ class InvalidationTests:
...
@@ -349,8 +349,8 @@ class InvalidationTests:
def
checkConcurrentUpdates2Storages
(
self
):
def
checkConcurrentUpdates2Storages
(
self
):
self
.
_storage
=
storage1
=
self
.
openClientStorage
()
self
.
_storage
=
storage1
=
self
.
openClientStorage
()
storage2
=
self
.
openClientStorage
()
db1
=
DB
(
storage1
)
db1
=
DB
(
storage1
)
storage2
=
self
.
openClientStorage
()
db2
=
DB
(
storage2
)
db2
=
DB
(
storage2
)
stop
=
threading
.
Event
()
stop
=
threading
.
Event
()
...
...
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