Listens for incoming TCP connections on a given endpoint.
More...
#include <tcp_listener.hpp>
Listens for incoming TCP connections on a given endpoint.
Definition at line 13 of file tcp_listener.hpp.
◆ tcp_listener() [1/3]
cbdc::network::tcp_listener::tcp_listener |
( |
| ) |
|
|
default |
◆ ~tcp_listener()
cbdc::network::tcp_listener::~tcp_listener |
( |
| ) |
|
|
override |
◆ tcp_listener() [2/3]
cbdc::network::tcp_listener::tcp_listener |
( |
const tcp_listener & | | ) |
|
|
delete |
◆ tcp_listener() [3/3]
cbdc::network::tcp_listener::tcp_listener |
( |
tcp_listener && | | ) |
|
|
delete |
◆ accept()
auto cbdc::network::tcp_listener::accept |
( |
tcp_socket & | sock | ) |
-> bool |
Blocks until an incoming connection is ready and populates the given socket.
- Parameters
-
sock | the socket to attach to the incoming connection |
- Returns
- true if the listener successfully accepted a connection.
Definition at line 48 of file tcp_listener.cpp.
◆ close()
void cbdc::network::tcp_listener::close |
( |
| ) |
|
◆ listen()
Starts the listener on the given local port and address.
- Parameters
-
local_address | the address of the interface to listen on |
local_port | the port number to listen on |
- Returns
- true if the listener started listening successfully.
Definition at line 11 of file tcp_listener.cpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
The documentation for this class was generated from the following files: