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
21bcdfbf
Commit
21bcdfbf
authored
Oct 25, 2013
by
Sam Rushing
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #47 from sgalaburda/fix-create-connection
Fixed create_connection() to match the emulated one.
parents
f9c12264
f523cf87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
coro/emulation/socket.py
coro/emulation/socket.py
+6
-4
No files found.
coro/emulation/socket.py
View file @
21bcdfbf
...
...
@@ -262,7 +262,7 @@ SocketType = socket
_GLOBAL_DEFAULT_TIMEOUT
=
object
()
def
create_connection
(
address
,
timeout
=
_GLOBAL_DEFAULT_TIMEOUT
):
def
create_connection
(
address
,
timeout
=
_GLOBAL_DEFAULT_TIMEOUT
,
source_address
=
None
):
# This is copied directly from Python's implementation.
msg
=
"getaddrinfo returns an empty list"
host
,
port
=
address
...
...
@@ -273,6 +273,8 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
sock
=
socket
(
af
,
socktype
,
proto
)
if
timeout
is
not
_GLOBAL_DEFAULT_TIMEOUT
:
sock
.
settimeout
(
timeout
)
if
source_address
:
sock
.
bind
(
source_address
)
sock
.
connect
(
sa
)
return
sock
...
...
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