net
Classes
| 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. |
Enumerations
| Name | Description |
|---|---|
TransportType | Transport protocol identifier used to distinguish socket types at runtime. |
SocketMode | Transport mode for socket adapters and accepted connections. |
TransportType
enum TransportTypeDefined in src/net/include/icy/net/net.h:93
Transport protocol identifier used to distinguish socket types at runtime.
| Value | Description |
|---|---|
UDP | Unreliable datagram protocol. |
TCP | Reliable stream protocol. |
SSLTCP | TLS-encrypted TCP stream. |
SocketMode
enum SocketModeDefined in src/net/include/icy/net/net.h:102
Transport mode for socket adapters and accepted connections.
| Value | Description |
|---|---|
ServerSide | Server-side adapter. |
ClientSide | Client-side adapter. |
Functions
| 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. |
makeSocket
inline
template<class SocketT> inline std::shared_ptr< SocketT > makeSocket(uv::Loop * loop = uv::defaultLoop())Defined in src/net/include/icy/net/socket.h:41
Creates a socket of type SocketT wrapped in a shared_ptr.
The socket is automatically destroyed when the last shared_ptr owner releases it.
Returns
A shared_ptr owning the newly created socket.
Parameters
| Parameter | Type | Description |
|---|---|---|
loop | uv::Loop * | Event loop to associate with the socket; defaults to the default loop. |
convertVerificationMode
inline
inline SSLContext::VerificationMode convertVerificationMode(const std::string & vMode)Defined in src/net/include/icy/net/sslcontext.h:325
Non-case sensitive conversion of a string to a VerificationMode enum. If verMode is illegal an ArgumentException is thrown.
convertCertificateError
inline
inline std::string convertCertificateError(long errCode)Defined in src/net/include/icy/net/sslcontext.h:345
Converts an SSL certificate handling error code into an error message.
getLastError
inline
inline std::string getLastError()Defined in src/net/include/icy/net/sslcontext.h:352
Returns the last error from the error stack.
clearErrorStack
inline
inline void clearErrorStack()Defined in src/net/include/icy/net/sslcontext.h:364
Clears the error stack.
getNetworkInterfaces
inline
inline void getNetworkInterfaces(std::vector< net::Address > & hosts)Defined in src/net/include/icy/net/util.h:36
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.
Parameters
| Parameter | Type | Description |
|---|---|---|
hosts | std::vector< net::Address > & | Vector to append the discovered addresses to. |
getServerSocketSendBufSize
template<typename T> int getServerSocketSendBufSize(uv::Handle< T > & handle)Defined in src/net/include/icy/net/util.h:79
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.
Returns
The send buffer size, or a libuv error code on failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | uv::Handle< T > & | The socket handle to query. |
getServerSocketRecvBufSize
template<typename T> int getServerSocketRecvBufSize(uv::Handle< T > & handle)Defined in src/net/include/icy/net/util.h:92
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.
Returns
The receive buffer size, or a libuv error code on failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | uv::Handle< T > & | The socket handle to query. |
setServerSocketSendBufSize
template<typename T> int setServerSocketSendBufSize(uv::Handle< T > & handle, int size)Defined in src/net/include/icy/net/util.h:105
Sets the send buffer size for a socket handle.
Returns
0 on success, or a libuv error code on failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | uv::Handle< T > & | The socket handle to configure. |
size | int | The desired send buffer size in bytes. |
setServerSocketRecvBufSize
template<typename T> int setServerSocketRecvBufSize(uv::Handle< T > & handle, int size)Defined in src/net/include/icy/net/util.h:117
Sets the receive buffer size for a socket handle.
Returns
0 on success, or a libuv error code on failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | uv::Handle< T > & | The socket handle to configure. |
size | int | The desired receive buffer size in bytes. |
Variables
| Return | Name | Description |
|---|---|---|
constexpr int | MAX_TCP_PACKET_SIZE constexpr | Maximum size of a single TCP receive buffer, in bytes. |
constexpr int | MAX_UDP_PACKET_SIZE constexpr | Maximum size of a single UDP datagram payload, in bytes. |
MAX_TCP_PACKET_SIZE
constexpr
constexpr int MAX_TCP_PACKET_SIZE = 64 * 1024Defined in src/net/include/icy/net/net.h:86
Maximum size of a single TCP receive buffer, in bytes.
MAX_UDP_PACKET_SIZE
constexpr
constexpr int MAX_UDP_PACKET_SIZE = 1500Defined in src/net/include/icy/net/net.h:89
Maximum size of a single UDP datagram payload, in bytes.
