boost::corosio::local_stream_acceptor
An asynchronous Unix domain stream acceptor for coroutine I/O.
Synopsis
class local_stream_acceptor
: public io_object
Description
This class provides asynchronous Unix domain stream accept operations that return awaitable types. The acceptor binds to a local endpoint (filesystem path or abstract name) and listens for incoming connections.
The library does NOT automatically unlink the socket path on close. Callers are responsible for removing the socket file before bind (via bind_option::unlink_existing) or after close.
Thread Safety
Distinct objects: Safe. Shared objects: Unsafe. An acceptor must not have concurrent accept operations.
Example
io_context ioc;
local_stream_acceptor acc(ioc);
acc.open();
acc.bind(local_endpoint("/tmp/my.sock"),
bind_option::unlink_existing);
acc.listen();
auto [ec, peer] = co_await acc.accept();
Types
Name |
Description |
RAII wrapper for I/O object implementation lifetime. |
|
Backend hooks for local stream acceptor operations. |
|
Service interface for I/O object lifecycle management. |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor. |
|
Move assignment operator. |
|
|
Bind to a local endpoint. |
|
Cancel pending asynchronous accept operations. |
|
Close the acceptor. |
|
Return the execution context. |
|
Get a socket option from the acceptor. |
|
Check if the acceptor has an open socket handle. |
|
Start listening for incoming connections. |
|
Return the local endpoint the acceptor is bound to. |
|
Create the acceptor socket. |
|
Release ownership of the native socket handle. |
|
Set a socket option on the acceptor. |
Protected Member Functions
Name |
Description |
|
Constructors |
|
Move assign from another I/O object. |
Protected Static Member Functions
Name |
Description |
Create a handle bound to a service found in the context. |
|