#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::function< void(const std::shared_ptr< AutoConnectControl > &)> & | getOnAutoConnectControl () |
| const SocketServer & | setOnAutoConnectControl (const std::function< void(const std::shared_ptr< AutoConnectControl > &)> &onAutoConnectControl, bool initialize=false) const |
| std::function< void(core::eventreceiver::AcceptEventReceiver *)> & | getOnInitState () const |
| const SocketServer & | setOnInitState (const std::function< void(core::eventreceiver::AcceptEventReceiver *)> &onInitState, bool initialize=false) const |
| 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) | |
| SocketServer (const std::shared_ptr< Config > &config, const std::shared_ptr< Context > &sharedContext) | |
| 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 > | |
| const 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 107 of file SocketServer.h.
References sharedContext.
|
inlineprivate |
Definition at line 116 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 122 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 172 of file SocketServer.h.
|
inline |
Definition at line 179 of file SocketServer.h.
|
inlineexplicit |
Definition at line 183 of file SocketServer.h.
|
inline |
Definition at line 317 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 274 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 288 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 302 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 340 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 356 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 259 of file SocketServer.h.
|
inline |
Definition at line 266 of file SocketServer.h.
|
inline |
Definition at line 255 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 188 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, and core::SNodeC::state().
Referenced by listen(), and realListen().
|
inline |
Definition at line 322 of file SocketServer.h.
References core::EventReceiver::atNextTick(), and sharedContext.
|
inline |
Definition at line 278 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 292 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 306 of file SocketServer.h.
References sharedContext.
|
inline |
Definition at line 344 of file SocketServer.h.
References sharedContext.
Referenced by main().
|
private |
Definition at line 361 of file SocketServer.h.
Referenced by getOnAutoConnectControl(), getOnConnect(), getOnConnected(), getOnDisconnect(), getOnInitState(), getSocketContextFactory(), setOnAutoConnectControl(), setOnConnect(), setOnConnected(), setOnDisconnect(), setOnInitState(), SocketServer(), SocketServer(), and SocketServer().