boost::corosio::native_tcp_acceptor

An asynchronous TCP acceptor with devirtualized accept operations.

Synopsis

template<auto Backend>
class native_tcp_acceptor
    : public tcp_acceptor

Description

This class template inherits from tcp_acceptor and shadows the accept operation with a version that calls the backend implementation directly, allowing the compiler to inline through the entire call chain.

Non‐async operations (listen, close, cancel) remain unchanged and dispatch through the compiled library.

A native_tcp_acceptor IS‐A tcp_acceptor and can be passed to any function expecting tcp_acceptor&.

Thread Safety

Same as tcp_acceptor.

Base Classes

Name

Description

tcp_acceptor

An asynchronous TCP acceptor for coroutine I/O.

Types

Name

Description

handle

RAII wrapper for I/O object implementation lifetime.

implementation

Define backend hooks for TCP acceptor operations.

io_service

Service interface for I/O object lifecycle management.

Member Functions

Name

Description

native_tcp_acceptor [constructor] [deleted]

Constructors

operator= [deleted]

Assignment operators

accept

accept overloads

bind

Bind to a local endpoint.

cancel

Cancel any pending asynchronous operations.

close

Close the acceptor.

context

Return the execution context.

get_option

Get a socket option from the acceptor.

is_open

Check if the acceptor is listening.

listen

Start listening for incoming connections.

local_endpoint

Get the local endpoint of the acceptor.

open

Create the acceptor socket without binding or listening.

set_option

Set a socket option on the acceptor.

wait

Asynchronously wait for the acceptor to be ready.

Protected Member Functions

Name

Description

operator= [deleted]

Move assign from another I/O object.

Protected Static Member Functions

Name

Description

create_handle

Create a handle bound to a service found in the context.

reset_peer_impl

Transfer accepted peer impl to the peer socket.

Protected Data Members

Name

Description

h_

The platform I/O handle owned by this object.

Template Parameters

Name

Description

Backend

A backend tag value (e.g., epoll).

See Also

tcp_acceptor, epoll_t, iocp_t

Created with MrDocs