-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local address support. #100
Changes from all commits
0faa59a
4b41aaa
731dcf8
a2faecb
96cb808
8fdc117
cc4963e
9cd0dee
6285d29
abb518f
36acad7
e634023
3790805
29070ad
04be66b
91f4104
e55fb6e
9d9def2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,12 @@ async def open_tcp_stream( | |
port: int, | ||
ssl_context: Optional[SSLContext], | ||
timeout: TimeoutDict, | ||
local_addr: Optional[bytes], | ||
) -> AsyncSocketStream: | ||
# trio doesn't currently support specifying the local address; it will | ||
# as of 0.16.1. | ||
if local_addr: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a comment that it is currently supported in Also, what will our implementation change look like once trio support does land here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm adding a comment. I believe the code would just add something like |
||
raise NotImplementedError() | ||
connect_timeout = none_as_inf(timeout.get("connect")) | ||
exc_map = { | ||
trio.TooSlowError: ConnectTimeout, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check - Do we want
local_addr
orsource_addr
here?What are trio, asyncio, and the sync stdlib using for their naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncio uses
local_addr
, trio useslocal_address
, and the stdlib socket module usessource_address
(and curio usessource_addr
). There's really no consistency.