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
b4ecd30b
Commit
b4ecd30b
authored
8 years ago
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify acceptor setup logic
After reading run_until_complete doc :)
parent
edb198a0
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
src/ZEO/asyncio/server.py
src/ZEO/asyncio/server.py
+10
-13
No files found.
src/ZEO/asyncio/server.py
View file @
b4ecd30b
...
@@ -224,10 +224,8 @@ class Acceptor(object):
...
@@ -224,10 +224,8 @@ class Acceptor(object):
cr
=
loop
.
create_unix_server
(
self
.
factory
,
addr
,
ssl
=
ssl
)
cr
=
loop
.
create_unix_server
(
self
.
factory
,
addr
,
ssl
=
ssl
)
f
=
asyncio
.
async
(
cr
,
loop
=
loop
)
f
=
asyncio
.
async
(
cr
,
loop
=
loop
)
server
=
loop
.
run_until_complete
(
f
)
@
f
.
add_done_callback
def
listenting
(
f
):
server
=
f
.
result
()
self
.
server
=
server
self
.
server
=
server
if
isinstance
(
addr
,
tuple
)
and
addr
[
1
]
==
0
:
if
isinstance
(
addr
,
tuple
)
and
addr
[
1
]
==
0
:
addrs
=
[
s
.
getsockname
()
for
s
in
server
.
sockets
]
addrs
=
[
s
.
getsockname
()
for
s
in
server
.
sockets
]
...
@@ -236,9 +234,8 @@ class Acceptor(object):
...
@@ -236,9 +234,8 @@ class Acceptor(object):
self
.
addr
=
addrs
[
0
]
self
.
addr
=
addrs
[
0
]
else
:
else
:
self
.
addr
=
server
.
sockets
[
0
].
getsockname
()[:
len
(
addr
)]
self
.
addr
=
server
.
sockets
[
0
].
getsockname
()[:
len
(
addr
)]
logger
.
info
(
"listening on %s"
,
str
(
addr
))
lo
op
.
run_until_complete
(
f
)
lo
gger
.
info
(
"listening on %s"
,
str
(
addr
)
)
def
factory
(
self
):
def
factory
(
self
):
try
:
try
:
...
...
This diff is collapsed.
Click to expand it.
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