boost::corosio::tcp_acceptor::local_endpoint

Get the local endpoint of the acceptor.

Synopsis

endpoint
local_endpoint() const noexcept;

Description

Returns the local address and port to which the acceptor is bound. This is useful when binding to port 0 (ephemeral port) to discover the OS‐assigned port number. The endpoint is cached when listen() is called.

Thread Safety

The cached endpoint value is set during listen() and cleared during close(). This function may be called concurrently with accept operations, but must not be called concurrently with listen() or close().

Return Value

The local endpoint, or a default endpoint (0.0.0.0:0) if the acceptor is not listening.

Created with MrDocs