8 #ifndef _TASKS_ACCEPTOR_H_
9 #define _TASKS_ACCEPTOR_H_
33 tdbg(
"acceptor(" <<
this <<
"): listening on port " << port << std::endl);
37 terr(
"acceptor(" <<
this <<
"): " << e.
what() << std::endl);
47 tdbg(
"acceptor(" <<
this <<
"): listening on unix:" << path << std::endl);
51 terr(
"acceptor(" <<
this <<
"): " << e.
what() << std::endl);
62 tdbg(
"acceptor(" <<
this <<
"): new client fd " << client.
fd() << std::endl);
63 T*
task =
new T(client);
77 terr(
"acceptor(" <<
this <<
"): " << e.
what() << std::endl);
87 #endif // _TASKS_ACCEPTOR_H_
The base class for any task.
static void add_task(net_io_task *task)
bool handle_event(worker *worker, int)
The net_io_task implements the base for socket based network tasks.
socket accept()
Accept new client connections.
void shutdown()
Call shutdown on the fd.
net::socket & socket()
Provide access to the underlying socket object.
const char * what() const noexcept
Return the error message.
void listen(std::string path, int queue_size=128)
acceptor(std::string path)