Low-level network and serial I/O. All transport GClasses use io_uring
for non-blocking operations.
Source: kernel/c/root-linux/src/c_tcp.c, c_tcp_s.c, c_udp.c,
c_udp_s.c, c_uart.c
C_TCP ¶ TCP transport — client and client-of-server. Supports optional TLS/SSL.
Property Value States ST_STOPPED, ST_DISCONNECTED, ST_WAIT_STOPPED, ST_WAIT_CONNECTED, ST_WAIT_HANDSHAKE, ST_CONNECTEDInput events EV_CONNECT, EV_TX_DATA, EV_DROP, EV_TIMEOUTOutput events EV_CONNECTED, EV_DISCONNECTED, EV_RX_DATA, EV_TX_READY
Key attributes ¶ Attribute Type Description urlstringConnection URL (e.g. tcp://host:port, ssl://host:port). connectedboolCurrent connection state (volatile, read-only). use_sslboolEnable TLS on the connection. cryptojsonTLS configuration (certificates, keys). rx_buffer_sizeintegerReceive buffer size in bytes. timeout_inactivityintegerInactivity timeout in seconds (-1 = no timeout). timeout_between_connectionsintegerIdle delay between reconnection attempts, in milliseconds (default 2000). timeout_between_connections_maxintegerIf > timeout_between_connections, the reconnect delay backs off exponentially from the base up to this cap (ms), resetting to base once a connection is established (for a TLS client, only on a successful handshake). 0 (default) = disabled, legacy fixed interval. A peer that keeps failing no longer hammers at the base cadence. txBytesintegerTotal bytes transmitted (stat). rxBytesintegerTotal bytes received (stat). peernamestringRemote peer address (read-only). socknamestringLocal socket address (read-only).
Usage ¶ Typically used as the bottom gobj of a protocol GClass (C_PROT_TCP4H,
C_WEBSOCKET, etc.) or directly inside a C_CHANNEL.
C_TCP_S ¶ TCP server — listens on a URL and accepts connections.
Creates a child C_TCP (inside a C_CHANNEL) for each accepted client.
Property Value States ST_STOPPED, ST_IDLEInput events EV_CONNECTED, EV_DISCONNECTED, EV_RX_DATA, EV_TX_READY, EV_DROP, EV_STOPPEDOutput events EV_CONNECTED, EV_DISCONNECTED, EV_RX_DATA, EV_TX_READY
Key attributes ¶ Attribute Type Description urlstringListening URL (e.g. tcp://0.0.0.0:1234). backlogintegerListen backlog. sharedboolEnable port sharing (SO_REUSEPORT). cryptojsonTLS configuration for accepted connections. only_allowed_ipsboolRestrict connections to allowed IPs only. connxsintegerCurrent connection count (stat). tconnxsintegerTotal connection count (stat). clisrv_kwjsonExtra kw passed to each child client/server.
Commands ¶ Command Description helpShow available commands. view-servicesList connected client channels.
C_UDP ¶ UDP client transport — send and receive datagrams.
Property Value States ST_STOPPED, ST_DISCONNECTED, ST_CONNECTEDInput events EV_CONNECT, EV_TX_DATA, EV_DROP, EV_TIMEOUTOutput events EV_CONNECTED, EV_DISCONNECTED, EV_RX_DATA, EV_TX_READY
Key attributes ¶ Attribute Type Description urlstringConnection URL. rx_buffer_sizeintegerReceive buffer size. txBytes / rxBytesintegerByte counters (stats). txMsgs / rxMsgsintegerMessage counters (stats).
C_UDP_S ¶ UDP server — listens for datagrams on a configured URL.
Property Value States ST_STOPPED, ST_IDLEInput events EV_RX_DATA, EV_TX_DATA, EV_STOPPEDOutput events EV_RX_DATA
Key attributes ¶ Attribute Type Description urlstringListening URL. sharedboolEnable port sharing. set_broadcastboolEnable broadcast. only_allowed_ipsboolRestrict to allowed IPs only. rx_buffer_sizeintegerReceive buffer size.
C_UART ¶ Serial port (UART/TTY) transport.
Property Value States ST_STOPPED, ST_DISCONNECTED, ST_WAIT_CONNECTED, ST_CONNECTEDInput events EV_CONNECT, EV_TX_DATA, EV_DROP, EV_TIMEOUTOutput events EV_CONNECTED, EV_DISCONNECTED, EV_RX_DATA
Key attributes ¶ Attribute Type Description urlstringDevice path (e.g. /dev/ttyUSB0). baudrateintegerBaud rate (default 115200). bytesizeintegerData bits (5–8, default 8). paritystringParity: "N", "E", "O". stopbitsintegerStop bits (1 or 2). xonxoffboolSoftware flow control. rtsctsboolHardware flow control.