Adbase
Adinf C++ base library V2
|
#include <Acceptor.hpp>
Public Types | |
typedef std::function< void(const InetAddress &, int)> | NewConnectionCallback |
Public Member Functions | |
Acceptor (EventBasePtr &base, const InetAddress &listenAddr, bool reuseport) | |
void | init () |
void | acceptHandler (int fd) |
void | setNewConnection (const NewConnectionCallback &cb) |
~Acceptor () | |
Definition at line 22 of file Acceptor.hpp.
typedef std::function<void (const InetAddress&, int)> adbase::Acceptor::NewConnectionCallback |
Definition at line 24 of file Acceptor.hpp.
adbase::Acceptor::Acceptor | ( | EventBasePtr & | base, |
const InetAddress & | listenAddr, | ||
bool | reuseport | ||
) |
Definition at line 22 of file Acceptor.cpp.
References adbase::Socket::bindAddress(), adbase::Socket::listen(), LOG_DEBUG, adbase::Socket::setReuseAddr(), adbase::Socket::setReusePort(), and adbase::InetAddress::toIpPort().
adbase::Acceptor::~Acceptor | ( | ) |
Definition at line 35 of file Acceptor.cpp.
void adbase::Acceptor::acceptHandler | ( | int | fd | ) |
Definition at line 53 of file Acceptor.cpp.
References adbase::Socket::accept(), adbase::Socket::fd(), LOG_DEBUG, LOG_ERROR, and adbase::InetAddress::toIpPort().
Referenced by adbase::detail::acceptHandler().
void adbase::Acceptor::init | ( | ) |
Definition at line 41 of file Acceptor.cpp.
References adbase::detail::acceptHandler(), adbase::sockets::close(), and adbase::Socket::fd().
Referenced by adbase::TcpServer::start().
|
inline |
Definition at line 28 of file Acceptor.hpp.
Referenced by adbase::TcpServer::TcpServer().