TCP/IP acceptor.
More...
#include <acceptor.hpp>
|
using | socket_type = typename boost::asio::ip::tcp::acceptor ::protocol_type::socket |
|
using | handler = std::function< void(std::error_code, std::shared_ptr< stream >)> |
| Accept completion handler. More...
|
|
boost::asio::io_context & | service_ |
| The I/O context. More...
|
|
boost::asio::ip::tcp::acceptor | acceptor_ |
| The underlying acceptor. More...
|
|
◆ ip_acceptor()
irccd::ip_acceptor::ip_acceptor |
( |
boost::asio::io_context & |
service, |
|
|
std::string |
address, |
|
|
std::uint16_t |
port, |
|
|
bool |
ipv4 = true , |
|
|
bool |
ipv6 = true |
|
) |
| |
|
inline |
Construct a TCP/IP acceptor.
If both ipv4 and ipv6 are set, the acceptor will listen on the two protocols.
To listen to any address, you can use "*" as address argument.
- Precondition
- at least ipv4 or ipv6 must be true
- Parameters
-
service | the I/O service |
address | the address to bind or * for any |
port | the port number |
ipv4 | enable ipv4 |
ipv6 | enable ipv6 |
◆ accept() [1/2]
void irccd::ip_acceptor::accept |
( |
handler |
handler | ) |
|
|
inlineoverridevirtual |
Start asynchronous accept.
Once the client is accepted, the original acceptor must be kept until it is destroyed.
- Precondition
- another accept operation must not be running
-
handler != nullptr
- Parameters
-
Implements irccd::acceptor.
◆ accept() [2/2]
template<typename Socket , typename Handler >
◆ basic_socket_acceptor() [1/2]
◆ basic_socket_acceptor() [2/2]
The documentation for this class was generated from the following file: