Bytemaster's Boost Libraries
|
Accepts new tcp sockets. More...
#include <acceptor.hpp>
Public Types | |
typedef boost::shared_ptr < acceptor > | ptr |
typedef boost::function< void(const tcp_socket_ptr, boost::system::error_code)> | handler |
Public Member Functions | |
void | listen (uint16_t port, const handler &on_con) |
Accepts new tcp sockets.
Provides a means to async listen for new tcp connections. The specified callback handler will be called any time a new connection arrives.
Unlike the boost::asio::tcp::acceptor, on_new_connection will be called in the current thread as a new 'fiber'.
acceptor acc; acc.listen( 8000, on_new_connection );