HDK
|
#include <NET_SocketListener.h>
Classes | |
struct | Empty |
struct | PortInfo |
Public Types | |
using | acceptor_type = AcceptorT |
using | socket_type = SocketT |
using | endpoint_type = typename AcceptorT::endpoint_type |
Public Member Functions | |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | start (int initial_port, int max_port_range=-1, bool use_system_port=false, const ASIO_IPAddress &address=ASIO_IPAddressV4()) |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | start () |
void | start (const ASIO_TCPEndpoint &ep) |
void | close (bool force) override |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
int | port () const |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | setPort (int port) |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | setMaxPort (int port) |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | setUseSystemPort (bool use_sys) |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | setUseIPv6 (bool use_v6) |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
bool | useIPv6 () const |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
void | setBindAddress (const ASIO_IPAddress &bind_address) |
template<typename S = SocketT, typename = typename std::enable_if_t<socket_info<S>::uses_port>> | |
const ASIO_IPAddress & | bindAddress () const |
endpoint_type | endpoint () const |
bool | isOpen () const override |
Public Member Functions inherited from NET_ISocketListener | |
virtual | ~NET_ISocketListener ()=default |
Protected Member Functions | |
NET_SocketListener (ASIO_IOContext &context) | |
virtual void | init_ () |
virtual void | onAccept_ (const hboost::system::error_code &ec, socket_type socket)=0 |
void | startAccept_ () |
Start an async accept. If the accept was a success onAccept_ is called. More... | |
Protected Member Functions inherited from NET_ISocketListener | |
NET_ISocketListener (ASIO_IOContext &context) | |
void | fail (const hboost::system::error_code &ec, const char *what) |
Called when something failed with the socket listener. More... | |
Protected Attributes | |
AcceptorT | myAcceptor |
std::conditional_t < socket_info< socket_type > ::uses_port, PortInfo, Empty > | myPortInfo |
Protected Attributes inherited from NET_ISocketListener | |
NET_ISocketGroup * | mySocketGroup |
ASIO_IOContext & | myIOContext |
NET_ConnectionManager | myConnectionManager |
Definition at line 80 of file NET_SocketListener.h.
using NET_SocketListener< AcceptorT, SocketT >::acceptor_type = AcceptorT |
Definition at line 83 of file NET_SocketListener.h.
using NET_SocketListener< AcceptorT, SocketT >::endpoint_type = typename AcceptorT::endpoint_type |
Definition at line 85 of file NET_SocketListener.h.
using NET_SocketListener< AcceptorT, SocketT >::socket_type = SocketT |
Definition at line 84 of file NET_SocketListener.h.
|
inlineprotected |
Definition at line 221 of file NET_SocketListener.h.
|
inline |
Definition at line 211 of file NET_SocketListener.h.
|
inlineoverridevirtual |
Implements NET_ISocketListener.
Definition at line 134 of file NET_SocketListener.h.
|
inline |
Definition at line 216 of file NET_SocketListener.h.
|
inlineprotectedvirtual |
Do any initialization after the socket listener has been setup but before we actually start accepting requests.
Definition at line 229 of file NET_SocketListener.h.
|
inlineoverridevirtual |
Implements NET_ISocketListener.
Definition at line 218 of file NET_SocketListener.h.
|
protectedpure virtual |
Called each time a new socket is accepted. Make sure to add the connection handler to the connection manager so that we can easily stop all requests that came from this listening socket when shutting down.
|
inline |
Returns the port the socket listener is bound to. It does not return the port that was requested to bind to.
Definition at line 162 of file NET_SocketListener.h.
|
inline |
Definition at line 204 of file NET_SocketListener.h.
|
inline |
Definition at line 176 of file NET_SocketListener.h.
|
inline |
Definition at line 169 of file NET_SocketListener.h.
|
inline |
Definition at line 190 of file NET_SocketListener.h.
|
inline |
Definition at line 183 of file NET_SocketListener.h.
|
inline |
Definition at line 90 of file NET_SocketListener.h.
void NET_SocketListener< AcceptorT, SocketT >::start | ( | ) |
Definition at line 262 of file NET_SocketListener.h.
|
inline |
Definition at line 107 of file NET_SocketListener.h.
|
protected |
Start an async accept. If the accept was a success onAccept_ is called.
Definition at line 296 of file NET_SocketListener.h.
|
inline |
Definition at line 197 of file NET_SocketListener.h.
|
protected |
Definition at line 242 of file NET_SocketListener.h.
|
protected |
Definition at line 256 of file NET_SocketListener.h.