C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::tcp_accept_socket Struct Reference

Represents a TCP acceptor in listening mode. More...

#include <tcp_accept_socket.hpp>

Inheritance diagram for caf::net::tcp_accept_socket:
caf::net::network_socket caf::net::socket caf::detail::comparable< socket >

Public Types

using super = network_socket
 The parent type.
 
using transport_type = octet_stream::transport
 The default transport for exchanging raw bytes over accepted sockets.
 
- Public Types inherited from caf::net::network_socket
using super = socket
 

Related Symbols

(Note that these are not member symbols.)

expected< tcp_accept_socket > CAF_NET_EXPORT make_tcp_accept_socket (ip_endpoint node, bool reuse_addr=true)
 Creates a new TCP socket to accept connections on a given port.
 
expected< tcp_accept_socket > CAF_NET_EXPORT make_tcp_accept_socket (const uri::authority_type &node, bool reuse_addr=true)
 Creates a new TCP socket to accept connections on a given port.
 
expected< tcp_accept_socket > CAF_NET_EXPORT make_tcp_accept_socket (uint16_t port, std::string addr="0.0.0.0", bool reuse_addr=true)
 Creates a new TCP socket to accept connections on a given port.
 
expected< tcp_stream_socket > CAF_NET_EXPORT accept (tcp_accept_socket x)
 Accepts a connection on x.
 

Additional Inherited Members

- Public Member Functions inherited from caf::net::socket
constexpr socket (socket_id id) noexcept
 
constexpr socket (const socket &other) noexcept=default
 
socketoperator= (const socket &other) noexcept=default
 
constexpr signed_socket_id compare (socket other) const noexcept
 
constexpr operator bool () const noexcept
 
constexpr bool operator! () const noexcept
 
constexpr socket fd () const noexcept
 
- Public Attributes inherited from caf::net::socket
socket_id id
 

Detailed Description

Represents a TCP acceptor in listening mode.

Friends And Related Symbol Documentation

◆ accept()

expected< tcp_stream_socket > CAF_NET_EXPORT accept ( tcp_accept_socket x)
related

Accepts a connection on x.

Parameters
xListening endpoint.
Returns
The socket that handles the accepted connection on success, an error otherwise.

◆ make_tcp_accept_socket() [1/3]

expected< tcp_accept_socket > CAF_NET_EXPORT make_tcp_accept_socket ( const uri::authority_type & node,
bool reuse_addr = true )
related

Creates a new TCP socket to accept connections on a given port.

Parameters
nodeThe endpoint to listen on and the filter for incoming addresses. Passing the address 0.0.0.0 will accept incoming connection from any host. Passing port 0 lets the OS choose the port.
reuse_addrOptionally sets the SO_REUSEADDR option on the socket.

◆ make_tcp_accept_socket() [2/3]

expected< tcp_accept_socket > CAF_NET_EXPORT make_tcp_accept_socket ( ip_endpoint node,
bool reuse_addr = true )
related

Creates a new TCP socket to accept connections on a given port.

Parameters
nodeThe endpoint to listen on and the filter for incoming addresses. Passing the address 0.0.0.0 will accept incoming connection from any host. Passing port 0 lets the OS choose the port.

◆ make_tcp_accept_socket() [3/3]

expected< tcp_accept_socket > CAF_NET_EXPORT make_tcp_accept_socket ( uint16_t port,
std::string addr = "0.0.0.0",
bool reuse_addr = true )
related

Creates a new TCP socket to accept connections on a given port.

Parameters
portThe port for listening to incoming connection. Passing 0 lets the OS choose a port.
addrThe filter for incoming addresses. Passing the address 0.0.0.0 will accept incoming connection from any host.
reuse_addrOptionally sets the SO_REUSEADDR option on the socket.

The documentation for this struct was generated from the following file: