Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
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
shrapnel
Commits
b4d13a0f
Commit
b4d13a0f
authored
Aug 20, 2012
by
Sam Rushing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server.start(): use self.create_sock() rather than assuming coro.tcp_sock()
parent
28a42eeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
coro/http/server.py
coro/http/server.py
+10
-2
No files found.
coro/http/server.py
View file @
b4d13a0f
...
...
@@ -454,11 +454,11 @@ class server:
Try up to <retries> time to bind to that address.
Raises an exception if the bind fails."""
self.sock = coro.tcp_sock()
self.addr = addr
self.sock = self.create_sock()
self.sock.set_reuse_addr()
done = 0
save_errno = 0
self.addr = addr
while not done:
for x in xrange (retries):
try:
...
...
@@ -501,6 +501,14 @@ class server:
def accept (self):
return self.sock.accept()
def create_sock (self):
# the assumption here is that you would never run an HTTP server
# on a unix socket, if you need that then override this method.
if '
:
' in self.addr[0]:
return coro.tcp6_sock()
else:
return coro.tcp_sock()
def create_connection (self):
return connection (self)
...
...
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