#include <io_service.hpp>
|
| io_service () |
|
void | run () |
|
bool | is_running () const |
|
void | shutdown () |
|
template<typename AcceptCallback > |
void | accept (const std::shared_ptr< acceptor > &ac, const tcp::peer &ep, AcceptCallback accept_callback) |
|
template<typename AcceptCallback > |
void | accept (const std::shared_ptr< acceptor > &ac, AcceptCallback accept_callback) |
|
template<typename ConnectCallback > |
void | connect (const std::shared_ptr< connector > &co, const std::string &port, ConnectCallback connect_callback) |
|
IO Service is used to encapsulate the an instance of the reactor class.
◆ io_service()
matador::io_service::io_service |
( |
| ) |
|
◆ accept() [1/2]
template<typename AcceptCallback >
void matador::io_service::accept |
( |
const std::shared_ptr< acceptor > & |
ac, |
|
|
AcceptCallback |
accept_callback |
|
) |
| |
Adds the given acceptor for the given callback.
The callback is called, when a new connection was accepted.
- Template Parameters
-
AcceptCallback | Type of callback |
- Parameters
-
ac | Acceptor used to accept connections |
accept_callback | Callback when connection was accepted |
◆ accept() [2/2]
template<typename AcceptCallback >
void matador::io_service::accept |
( |
const std::shared_ptr< acceptor > & |
ac, |
|
|
const tcp::peer & |
ep, |
|
|
AcceptCallback |
accept_callback |
|
) |
| |
Adds the given acceptor for the given peer endpoint and callback.
The callback is called, when a new connection was accepted.
- Template Parameters
-
AcceptCallback | Type of callback |
- Parameters
-
ac | Acceptor used to accept connections |
ep | Endpoint on which the acceptor will listen |
accept_callback | Callback when connection was accepted |
◆ connect()
template<typename ConnectCallback >
void matador::io_service::connect |
( |
const std::shared_ptr< connector > & |
co, |
|
|
const std::string & |
port, |
|
|
ConnectCallback |
connect_callback |
|
) |
| |
Add the given connector for the given port and execute callback.
Once a connection is established the callback is called.
- Template Parameters
-
ConnectCallback | Type of the callback |
- Parameters
-
co | Connector Used to establish the connection |
port | Port to execute to |
connect_callback | Callback when connection was established |
◆ is_running()
bool matador::io_service::is_running |
( |
| ) |
const |
Returns true if the io service is running
- Returns
- True if service is running
◆ run()
void matador::io_service::run |
( |
| ) |
|
◆ shutdown()
void matador::io_service::shutdown |
( |
| ) |
|
Shuts down a running service
The documentation for this class was generated from the following file:
- matador/net/io_service.hpp