irccd
3.0.3
|
Convenient acceptor owner. More...
#include <acceptor.hpp>
Public Types | |
using | socket_type = typename Acceptor::protocol_type::socket |
![]() | |
using | handler = std::function< void(std::error_code, std::shared_ptr< stream >)> |
Accept completion handler. More... | |
Public Member Functions | |
basic_socket_acceptor (boost::asio::io_context &service) | |
basic_socket_acceptor (boost::asio::io_context &service, Acceptor acceptor) noexcept | |
auto | get_service () const noexcept -> const boost::asio::io_context & |
auto | get_service () noexcept -> boost::asio::io_context & |
auto | get_acceptor () const noexcept -> const Acceptor & |
auto | get_acceptor () noexcept -> Acceptor & |
template<typename Socket , typename Handler > | |
void | accept (Socket &sc, Handler handler) |
![]() | |
acceptor ()=default | |
virtual | ~acceptor ()=default |
virtual void | accept (handler handler)=0 |
Protected Attributes | |
boost::asio::io_context & | service_ |
The I/O context. More... | |
Acceptor | acceptor_ |
The underlying acceptor. More... | |
Convenient acceptor owner.
using irccd::basic_socket_acceptor< Acceptor >::socket_type = typename Acceptor::protocol_type::socket |
Underlying socket type.
|
inline |
Construct a basic_socket_acceptor.
service | the I/O context |
|
inlinenoexcept |
Construct a basic_socket_acceptor with a already bound native acceptor.
service | the I/O context |
acceptor | the acceptor |
|
inline |
Accept a new client.
sc | the socket type |
handler | the handler |
|
inlinenoexcept |
Get the underlying acceptor.
|
inlinenoexcept |
Overloaded function.
|
inlinenoexcept |
Get the I/O context.
|
inlinenoexcept |
Overloaded function.
|
protected |
The underlying acceptor.
|
protected |
The I/O context.