Skip to content

socket.bind() is a blocking call #241

Closed
@njsmith

Description

@njsmith

...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 make bind async, and then drop the whole "pre-resolution" thing and if the user passes us an unresolved address, just silently resolve it for them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions