#include <irc/connection.hpp>
Inherits enable_shared_from_this< connection >.
IRC connection class.
Public Member Functions | |
| template<typename F > | |
| bsig::connection | connect_on_resolve (F &&f) |
| Connect to the on_resolve signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_connect (F &&f) |
| Connect to the on_connect signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_read_msg (F &&f) |
| Connect to the on_read_msg signal. More... | |
| template<typename F > | |
| bsig::connection | connect_on_network_error (F &&f) |
| Connect to the on_network_error signal. More... | |
| connection (boost::asio::io_service &io_service, std::string host, std::string service) | |
| Constructor. More... | |
| void | stop () |
| Disconnects from IRC server. More... | |
| void | async_read () |
| Requests an asynchronous buffer read from the socket. More... | |
| void | async_write (std::string str) |
| Requests an asynchronous buffer write to the socket. More... | |
Static Public Member Functions | |
| static std::shared_ptr < connection > | make_shared (boost::asio::io_service &io_service, std::string host, std::string service) |
| Static constructor. More... | |
| irc::connection::connection | ( | boost::asio::io_service & | io_service, |
| std::string | host, | ||
| std::string | service | ||
| ) |
Constructor.
| io_service | A reference to the ASIO io_service. |
| host | An hostname to connect to. |
| service | The connection port as string. |
| void irc::connection::async_read | ( | ) |
Requests an asynchronous buffer read from the socket.
| void irc::connection::async_write | ( | std::string | str | ) |
Requests an asynchronous buffer write to the socket.
| str | Data to push back to the write buffer. |
| bsig::connection irc::connection::connect_on_connect | ( | F && | f | ) |
Connect to the on_connect signal.
This signal is triggered when connected to an IRC server.
| f | A callback function with the following signature: void f()
|
| bsig::connection irc::connection::connect_on_network_error | ( | F && | f | ) |
Connect to the on_network_error signal.
This signal is triggered when there was a connection error.
| f | A callback function with the following signature: void f(const std::string& error_msg)
|
| bsig::connection irc::connection::connect_on_read_msg | ( | F && | f | ) |
Connect to the on_read_msg signal.
This signal is triggered when an IRC server message was read.
| f | A callback function with the following signature: void f(const std::string& msg)
|
| bsig::connection irc::connection::connect_on_resolve | ( | F && | f | ) |
Connect to the on_resolve signal.
This signal is triggered when IRC server names was resolved.
| f | A callback function with the following signature: void f()
|
|
static |
Static constructor.
| io_service | A reference to the ASIO io_service. |
| host | An hostname to connect to. |
| service | The connection port as string. |
| void irc::connection::stop | ( | ) |
Disconnects from IRC server.