TCP Server Transport
Listens for a TCP client. Use it when the device connects out to a server it was configured with (a 4G/GPRS module, an ESP32, a gateway), or to stand in for a device while you test a client. The Modbus TCP loopback example uses it with the Modbus TCP Server codec. TCP carries a byte stream, so a codec splits it into messages.
- One client at a time: when a second client connects it replaces the first; both events are logged in the message list.
- Sending without a client fails with "No active TCP connection".
- Bind address:
0.0.0.0(or::) accepts connections from the network,127.0.0.1only from this computer. Ports below 1024 need extra privileges on Linux, and a firewall may block incoming connections.

Configuration reference
| Config ID | tcp_server_transport |
| Selected by | app_transport = "tcp_server_transport" |
| Platforms | Linux, Windows, Android |
| License | Premium |
TCP server accepting single client connection
Listening Configuration:
- Bind Address: Local listening address (supports both IPv4 and IPv6)
- IPv4 examples:
0.0.0.0- Listen on all IPv4 network interfaces, allow any client to connect127.0.0.1- Listen on loopback only, allow only local clients
- IPv6 examples:
::- Listen on all IPv6 network interfaces, allow any client to connect::1- Listen on IPv6 loopback onlyfe80::1- Listen on specific IPv6 address
- IPv4 examples:
- Bind Port: Port number the server will listen on
Operating Mode:
- Server starts listening on the specified address and port
- Automatically accepts client connections
- Supports only one client at a time, new connections replace old ones
- Automatically waits for new connections after client disconnects
| Setting | Key | Type | Default | Notes |
|---|---|---|---|---|
| Bind Address | tcp_server_transport_bind_address | Text (with presets) | "0.0.0.0" | Required |
| Port | tcp_server_transport_bind_port | Integer | 8080 | Required |
Setting details
Bind Address
Presets (any other value can be entered):
| Value | Label |
|---|---|
"0.0.0.0" | 0.0.0.0 (all IPv4) |
"::" | :: (all IPv6) |
"127.0.0.1" | 127.0.0.1 (localhost) |
"::1" | ::1 (localhost IPv6) |
Example config
Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.
{
"app": {
"app_transport": "tcp_server_transport"
},
"tcp_server_transport": {
"tcp_server_transport_bind_address": "0.0.0.0",
"tcp_server_transport_bind_port": 8080
}
}