#include <SocketServer.h>
Classes | |
| struct | Context |
Public Types | |
| using | SocketConnection = typename SocketAcceptor::SocketConnection |
| using | SocketAddress = typename SocketAcceptor::SocketAddress |
| using | Config = typename SocketAcceptor::Config |
| Public Types inherited from core::socket::Socket< SocketAcceptorT::Config > | |
| using | Config |
Public Member Functions | |
| SocketServer (const std::string &name, const std::function< void(SocketConnection *)> &onConnect, const std::function< void(SocketConnection *)> &onConnected, const std::function< void(SocketConnection *)> &onDisconnect, Args &&... args) | |
| SocketServer (const std::function< void(SocketConnection *)> &onConnect, const std::function< void(SocketConnection *)> &onConnected, const std::function< void(SocketConnection *)> &onDisconnect, Args &&... args) | |
| SocketServer (const std::string &name, Args &&... args) | |
| SocketServer (Args &&... args) | |
| const SocketServer & | listen (const std::function< void(const SocketAddress &, core::socket::State)> &onStatus) const |
| const SocketServer & | listen (const SocketAddress &localAddress, const std::function< void(const SocketAddress &, core::socket::State)> &onStatus) const |
| const SocketServer & | listen (const SocketAddress &localAddress, int backlog, const std::function< void(const SocketAddress &, core::socket::State)> &onStatus) const |
| std::function< void(SocketConnection *)> & | getOnConnect () const |
| const SocketServer & | setOnConnect (const std::function< void(SocketConnection *)> &onConnect, bool initialize=false) const |
| std::function< void(SocketConnection *)> & | getOnConnected () const |
| const SocketServer & | setOnConnected (const std::function< void(SocketConnection *)> &onConnected, bool initialize=false) const |
| std::function< void(SocketConnection *)> & | getOnDisconnect () const |
| SocketServer & | setOnDisconnect (const std::function< void(SocketConnection *)> &onDisconnect, bool initialize=false) |
| std::shared_ptr< SocketContextFactory > | getSocketContextFactory () const |
| Public Member Functions inherited from core::socket::Socket< SocketAcceptorT::Config > | |
| Socket (const std::string &name) | |
| virtual | ~Socket () |
| Config & | getConfig () const |
Private Types | |
| using | SocketAcceptor = SocketAcceptorT |
| using | SocketContextFactory = SocketContextFactoryT |
| using | Super = core::socket::Socket<typename SocketAcceptor::Config> |
Private Member Functions | |
| SocketServer (const std::shared_ptr< Config > &config, const std::shared_ptr< SocketContextFactory > &socketContextFactory, const std::function< void(SocketConnection *)> &onConnect, const std::function< void(SocketConnection *)> &onConnected, const std::function< void(SocketConnection *)> &onDisconnect) | |
| const SocketServer & | realListen (const std::function< void(const SocketAddress &, core::socket::State)> &onStatus, unsigned int tries, double retryTimeoutScale) const |
Private Attributes | |
| std::shared_ptr< Context > | sharedContext |
Additional Inherited Members | |
| Protected Member Functions inherited from core::socket::Socket< SocketAcceptorT::Config > | |
| Socket & | operator= (const Socket &)=default |
| Protected Attributes inherited from core::socket::Socket< SocketAcceptorT::Config > | |
| std::shared_ptr< Config > | config |
Definition at line 68 of file SocketServer.h.
| using core::socket::stream::SocketServer< SocketAcceptorT, SocketContextFactoryT, Args >::Config = typename SocketAcceptor::Config |
Definition at line 78 of file SocketServer.h.
|
private |
Definition at line 70 of file SocketServer.h.
| using core::socket::stream::SocketServer< SocketAcceptorT, SocketContextFactoryT, Args >::SocketAddress = typename SocketAcceptor::SocketAddress |
Definition at line 77 of file SocketServer.h.
| using core::socket::stream::SocketServer< SocketAcceptorT, SocketContextFactoryT, Args >::SocketConnection = typename SocketAcceptor::SocketConnection |
Definition at line 76 of file SocketServer.h.
|
private |
Definition at line 71 of file SocketServer.h.
|
private |
Definition at line 73 of file SocketServer.h.
|
inlineprivate |
Definition at line 81 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 91 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 141 of file SocketServer.h.
|
inline |
Definition at line 148 of file SocketServer.h.
|
inlineexplicit |
Definition at line 152 of file SocketServer.h.
|
inline |
Definition at line 242 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 256 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 270 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 285 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 227 of file SocketServer.h.
|
inline |
Definition at line 234 of file SocketServer.h.
|
inline |
Definition at line 223 of file SocketServer.h.
References realListen().
Referenced by main(), express::legacy::in6::Server(), express::legacy::in::Server(), express::legacy::rc::Server(), express::legacy::un::Server(), express::tls::in6::Server(), express::tls::in::Server(), express::tls::rc::Server(), and express::tls::un::Server().
|
inlineprivate |
Definition at line 157 of file SocketServer.h.
References core::EventReceiver::atNextTick(), core::socket::State::ERROR, core::socket::State::FATAL, utils::Random::getInRange(), core::INITIALIZED, core::socket::State::NO_RETRY, core::socket::State::operator&(), core::socket::State::operator&=(), core::socket::State::operator==(), realListen(), core::RUNNING, core::timer::Timer::singleshotTimer(), and core::SNodeC::state().
Referenced by listen(), and realListen().
|
inline |
Definition at line 246 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 260 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 274 of file SocketServer.h.
References sharedContext.
|
private |
Definition at line 307 of file SocketServer.h.
Referenced by getOnConnect(), getOnConnected(), getOnDisconnect(), getSocketContextFactory(), setOnConnect(), setOnConnected(), setOnDisconnect(), SocketServer(), and SocketServer().