-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
socket.bind() is a blocking call #241
Comments
I guess there are two options for handling this: Option 1: Always use Option 2: keep our "pre-resolving" code, but move it internal to |
Since currently, writing explicit |
...for UNIX domain sockets, since it has to do filesystem traversal.
And for non-UNIX-domain sockets, it also is if you pass in the host or port by name. So far we avoided this by making all the methods on trio.socket.socket only accept "pre-resolved" host/port combos. Which is a bit awkward; really the main motivation was that
bind
was logically a non-blocking call, so it can't call getaddrinfo, and then I made this the rule across-the-board to keep things consistent. But maybe it would be better to instead makebind
async, and then drop the whole "pre-resolution" thing and if the user passes us an unresolved address, just silently resolve it for them.The text was updated successfully, but these errors were encountered: