Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
|
#include <CAcceptorSocket.hpp>
Public Types | |
using | stream_sock_t = STREAM_SOCK |
using | addr_t = ADDR |
Public Member Functions | |
CAcceptorSocketTmpl ()=default | |
CAcceptorSocketTmpl (const addr_t &address, int32_t queueSize=DFLT_QUEUE_SIZE) | |
CAcceptorSocketTmpl (in_port_t port, int32_t queueSize=DFLT_QUEUE_SIZE) | |
CAcceptorSocketTmpl (CAcceptorSocketTmpl &&acc) noexcept | |
CAcceptorSocketTmpl (const CAcceptorSocketTmpl &)=delete | |
CAcceptorSocketTmpl & | operator= (const CAcceptorSocketTmpl &)=delete |
CAcceptorSocketTmpl & | operator= (CAcceptorSocketTmpl &&rhs) noexcept |
stream_sock_t | accept (addr_t *clientAddress=nullptr) |
stream_sock_t | acceptWithTimeout (addr_t *clientAddress, uint64_t timeout) |
bool | bind (const addr_t &address) |
bool | open (const addr_t &address, int32_t queueSize=DFLT_QUEUE_SIZE) |
bool | open (in_port_t port, int32_t queueSize=DFLT_QUEUE_SIZE) |
addr_t | getAddr () const |
bool | listen (int32_t queueSize=DFLT_QUEUE_SIZE) |
bool | open (const CSocketAddress &address, int32_t queueSize=DFLT_QUEUE_SIZE) |
CStreamSocket | accept (CSocketAddress *clientAddress=nullptr) |
CStreamSocket | acceptWithTimeout (CSocketAddress *clientAddress, uint64_t timeout) |
bool | operator! () const |
Operador de negación. | |
operator bool () const | |
Operador de conversión a bool. | |
virtual bool | bind (const CSocketAddress &address) |
Asigna una dirección a un socket. | |
bool | bind (const sockaddr *address, socklen_t len) const |
bool | isOpen () const |
Comprueba que el handle del socket sea válido. | |
socket_t | release () |
Pone a -1 el handle interno y devuelve el valor anterior. Al no invalidar el file descriptor del socket, se puede usar para desasociar el socket del Sistema Operativo de un objeto CSocket concreto. | |
void | reset (socket_t handle=INVALID_SOCKET) |
Asigna un nuevo handle al socket e invalida el anterior. | |
CSocket | clone () const |
Crea un nuevo objeto CSocket con el mismo handle que el actual. | |
bool | close () |
Cierra el socket. | |
virtual CSocketAddressAny | getAddress () const |
virtual CSocketAddressAny | getPeerAddress () const |
virtual sa_family_t | getFamily () const |
socket_t | getHandle () const |
void | setLastError (int32_t err=INT32_MAX) const |
std::string | getLastErrorString () const |
void | clearLastError (int32_t value=0) const |
bool | getOption (int32_t level, int32_t optName, void *optVal, socklen_t *optLength) const |
template<typename T > | |
bool | getOption (const int32_t level, const int32_t optName, T *value) const |
bool | setOption (int32_t level, int32_t optName, const void *optVal, socklen_t optLength) const |
template<typename T > | |
bool | setOption (const int32_t level, const int32_t optName, const T &value) |
bool | setNonBlocking (bool on=true) const |
Static Public Member Functions | |
static CAcceptorSocketTmpl | create () |
static CAcceptorSocket | create (int32_t domain) |
static CSocket | create (int32_t domain, int32_t type, int32_t protocol=0) |
static bool | close (socket_t h) |
static std::tuple< CSocket, CSocket > | pair (int32_t domain, int32_t type, int32_t protocol=0) |
Protected Member Functions | |
template<typename T > | |
T | checkRet (T ret) const |
template<typename T > | |
bool | checkRetBool (T ret) const |
socket_t | checkSocket (socket_t ret) const |
bool | checkSocketBool (socket_t ret) const |
bool | closeOnError () |
Static Protected Member Functions | |
static socket_t | createHandle (int32_t domain) |
static int32_t | getErrno () |
Función que devuelve el valor actual de errno. | |
Protected Attributes | |
socket_t | m_handle |
Static Protected Attributes | |
static const int32_t | DFLT_QUEUE_SIZE = 4 |
Private Attributes | |
int32_t | m_lastError |
using CAcceptorSocketTmpl< STREAM_SOCK, ADDR >::addr_t = ADDR |
using CAcceptorSocketTmpl< STREAM_SOCK, ADDR >::stream_sock_t = STREAM_SOCK |
|
default |
|
inlineexplicit |
|
inlineexplicit |
|
inlinenoexcept |
|
delete |
|
inherited |
|
inline |
|
inherited |
|
inline |
|
inline |
|
virtualinherited |
Asigna una dirección a un socket.
address | Dirección a la que el socket se va a asociar. |
|
inherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inherited |
|
inherited |
|
inherited |
Cierra el socket.
|
staticinherited |
|
inlineprotectedinherited |
|
staticinherited |
|
inlinestatic |
|
staticinherited |
|
inlinestaticprotectedinherited |
|
inline |
|
virtualinherited |
|
staticprotectedinherited |
Función que devuelve el valor actual de errno.
|
virtualinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
virtualinherited |
|
inherited |
Comprueba que el handle del socket sea válido.
|
inlineinherited |
|
inherited |
|
inline |
|
inline |
|
explicitinherited |
Operador de conversión a bool.
|
inherited |
Operador de negación.
|
inlinenoexcept |
|
delete |
|
staticinherited |
|
inherited |
Pone a -1 el handle interno y devuelve el valor anterior. Al no invalidar el file descriptor del socket, se puede usar para desasociar el socket del Sistema Operativo de un objeto CSocket concreto.
|
inherited |
Asigna un nuevo handle al socket e invalida el anterior.
handle | Nuevo handle a asignar. |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
staticprotectedinherited |
|
protectedinherited |
|
mutableprivateinherited |