Socket transports, adapters, and address helpers.
| Name | Description |
|---|---|
Address | Represents an IPv4 or IPv6 socket address with host and port. |
PacketSocketEmitter | Socket adapter that emits received data as packets. |
Socket | Base socket implementation from which all sockets derive. |
SocketAdapter | Abstract adapter interface for socket send/receive chains. |
SocketEmitter | SocketAdapter that exposes socket events as signals. |
SocketPacket | Default packet type emitted by sockets. |
SSLAdapter | Manages the OpenSSL context and BIO buffers for an SSL socket connection. |
SSLContext | OpenSSL SSL_CTX wrapper for client and server TLS configuration. |
SSLManager | Singleton that owns the default client/server TLS contexts and related callbacks. |
SSLSession | Cached SSL/TLS session wrapper used for client-side resumption. |
SSLSocket | SSL socket implementation. |
TCPSocket | TCP socket implementation. |
Transaction | Request/response helper for packet types emitted from a socket. |
UDPSocket | UDP socket implementation. |
VerificationErrorDetails | A utility class for certificate error handling. |
PacketInfo | Provides information about packets emitted from a socket. See SocketPacket. |
| Name | Description |
|---|---|
TransportType | Transport protocol identifier used to distinguish socket types at runtime. |
SocketMode | Transport mode for socket adapters and accepted connections. |
enum TransportTypeTransport protocol identifier used to distinguish socket types at runtime.
| Value | Description |
|---|---|
UDP | Unreliable datagram protocol. |
TCP | Reliable stream protocol. |
SSLTCP | TLS-encrypted TCP stream. |
enum SocketModeTransport mode for socket adapters and accepted connections.
| Value | Description |
|---|---|
ServerSide | Server-side adapter. |
ClientSide | Client-side adapter. |
| Return | Name | Description |
|---|---|---|
std::shared_ptr< SocketT > | makeSocket inline | Creates a socket of type SocketT wrapped in a shared_ptr. |
SSLContext::VerificationMode | convertVerificationMode inline | Non-case sensitive conversion of a string to a VerificationMode enum. If verMode is illegal an ArgumentException is thrown. |
std::string | convertCertificateError inline | Converts an SSL certificate handling error code into an error message. |
std::string | getLastError inline | Returns the last error from the error stack. |
void | clearErrorStack inline | Clears the error stack. |
void | getNetworkInterfaces inline | Populates hosts with all local network interface addresses. |
int | getServerSocketSendBufSize | Returns the current send buffer size for a socket handle, in bytes. Passes val=0 to uv_send_buffer_size, which queries rather than sets the value. |
int | getServerSocketRecvBufSize | Returns the current receive buffer size for a socket handle, in bytes. Passes val=0 to uv_recv_buffer_size, which queries rather than sets the value. |
int | setServerSocketSendBufSize | Sets the send buffer size for a socket handle. |
int | setServerSocketRecvBufSize | Sets the receive buffer size for a socket handle. |
inline
template<class SocketT> inline std::shared_ptr< SocketT > makeSocket(uv::Loop * loop)Creates a socket of type SocketT wrapped in a shared_ptr.
The socket is automatically destroyed when the last shared_ptr owner releases it.
loop Event loop to associate with the socket; defaults to the default loop.A shared_ptr owning the newly created socket.
inline
inline SSLContext::VerificationMode convertVerificationMode(const std::string & vMode)Non-case sensitive conversion of a string to a VerificationMode enum. If verMode is illegal an ArgumentException is thrown.
inline
inline std::string convertCertificateError(long errCode)Converts an SSL certificate handling error code into an error message.
inline
inline std::string getLastError()Returns the last error from the error stack.
inline
inline void clearErrorStack()Clears the error stack.
inline
inline void getNetworkInterfaces(std::vector< net::Address > & hosts)Populates hosts with all local network interface addresses.
Each entry is an IPv4 address constructed from the interface's address4 field. The results include loopback and any other active interfaces reported by libuv.
hosts Vector to append the discovered addresses to.template<typename T> int getServerSocketSendBufSize(uv::Handle< T > & handle)Returns the current send buffer size for a socket handle, in bytes. Passes val=0 to uv_send_buffer_size, which queries rather than sets the value.
T The libuv handle type (e.g. uv_tcp_t, uv_udp_t).handle The socket handle to query.The send buffer size, or a libuv error code on failure.
template<typename T> int getServerSocketRecvBufSize(uv::Handle< T > & handle)Returns the current receive buffer size for a socket handle, in bytes. Passes val=0 to uv_recv_buffer_size, which queries rather than sets the value.
T The libuv handle type (e.g. uv_tcp_t, uv_udp_t).handle The socket handle to query.The receive buffer size, or a libuv error code on failure.
template<typename T> int setServerSocketSendBufSize(uv::Handle< T > & handle, int size)Sets the send buffer size for a socket handle.
T The libuv handle type (e.g. uv_tcp_t, uv_udp_t).handle The socket handle to configure.
size The desired send buffer size in bytes.
0 on success, or a libuv error code on failure.
template<typename T> int setServerSocketRecvBufSize(uv::Handle< T > & handle, int size)Sets the receive buffer size for a socket handle.
T The libuv handle type (e.g. uv_tcp_t, uv_udp_t).handle The socket handle to configure.
size The desired receive buffer size in bytes.
0 on success, or a libuv error code on failure.
| Return | Name | Description |
|---|---|---|
constexpr int | MAX_TCP_PACKET_SIZE | Maximum size of a single TCP receive buffer, in bytes. |
constexpr int | MAX_UDP_PACKET_SIZE | Maximum size of a single UDP datagram payload, in bytes. |
constexpr int MAX_TCP_PACKET_SIZE = 64 * 1024Maximum size of a single TCP receive buffer, in bytes.
constexpr int MAX_UDP_PACKET_SIZE = 1500Maximum size of a single UDP datagram payload, in bytes.