irccd  3.0.3
Public Types | Public Member Functions | List of all members
irccd::local_connector Class Reference

Unix domain connector. More...

#include <connector.hpp>

Inheritance diagram for irccd::local_connector:
irccd::basic_socket_connector irccd::connector

Public Types

using socket_type = boost::asio::local::stream_protocol::socket
 
- Public Types inherited from irccd::connector
using handler = std::function< void(std::error_code, std::shared_ptr< stream >)>
 Connect completion handler. More...
 

Public Member Functions

 local_connector (boost::asio::io_context &service, boost::filesystem::path path) noexcept
 
template<typename Socket , typename Handler >
void connect (Socket &sc, Handler handler) noexcept
 
void connect (handler handler)
 
- Public Member Functions inherited from irccd::basic_socket_connector
 basic_socket_connector (boost::asio::io_context &service)
 
auto get_service () const noexcept -> const boost::asio::io_context &
 
auto get_service () noexcept -> boost::asio::io_context &
 
- Public Member Functions inherited from irccd::connector
 connector ()=default
 
virtual ~connector ()=default
 

Additional Inherited Members

- Protected Attributes inherited from irccd::basic_socket_connector
boost::asio::io_context & service_
 The I/O service. More...
 

Detailed Description

Unix domain connector.

Member Typedef Documentation

◆ socket_type

using irccd::local_connector::socket_type = boost::asio::local::stream_protocol::socket

Underlying socket type.

Constructor & Destructor Documentation

◆ local_connector()

irccd::local_connector::local_connector ( boost::asio::io_context &  service,
boost::filesystem::path  path 
)
inlinenoexcept

Construct a local connector.

Parameters
servicethe service
paththe path to the file

Member Function Documentation

◆ connect() [1/2]

void irccd::local_connector::connect ( handler  handler)
inlinevirtual

Start asynchronous connect.

Once the client is connected, the original acceptor must be kept until it is destroyed.

Precondition
another connect operation must not be running
handler != nullptr
Parameters
handlerthe handler

Implements irccd::connector.

◆ connect() [2/2]

template<typename Socket , typename Handler >
void irccd::local_connector::connect ( Socket &  sc,
Handler  handler 
)
inlinenoexcept

Connect to the given socket.

Parameters
scthe socket type
handlerthe handler
Note
implemented for SocketConnector concept

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