Skip to content

TcpAcceptor should be Clone like TcpStream #15595

Closed
@alexcrichton

Description

@alexcrichton

If you've got a task in an accept() loop, there's currently no easy way to shut it down. This should take a similar approach to TcpStream and friends by supporting a close_accept() method which will force all accept loops to return.

This will notably allow for accept() on the same socket concurrently, which needs to be accounted for. Unlike concurrent reads/writes this should be pretty easy to deal with.

libuv native unix native windows
TcpAcceptor::clone
TcpAcceptor::close_accept
UnixAcceptor::clone
UnixAcceptor::close_accept

WIP: https://github.com/alexcrichton/rust/tree/issue-15595

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions