Network node
TCP Server
Listen for incoming TCP connections and receive data as a TCP server.
Inputs
| Port | Type | Default |
|---|---|---|
| PortThe TCP port this server listens on. Use a valid port number 0…65535 — the default 8080 is a safe choice, and ports below 1024 usually need extra privileges. | int | 8080 |
| Max ClientsHow many clients may be connected at once; further connections are refused until a slot frees up. Not clamped, but 0 rejects everyone. | int | 4 |
| EnableStarts and stops the listener. Off closes the server and drops connected clients. | bool | true |
Outputs
| Port | Type |
|---|---|
| Data | string |
| Message | string |
| Connected | bool |
| Clients | int |
| TLS Active | bool |
| Authenticated | int |
| Bytes | int |
| Sender IP | string |
| TLS Error | string |
How It Works
Opens a TCP socket on the specified port and listens for incoming connections. The server supports multiple concurrent clients up to the Max Clients limit. When data arrives from any client, the Data output contains the raw received bytes as a string, while Message provides the latest complete message. Sender IP identifies which client sent the most recent message, making it possible to distinguish between multiple connected clients.
Use Cases
- Receiving real-time data streams from external applications
- Building a local network bridge between software tools
- Accepting sensor data from multiple networked devices simultaneously
- Creating a control server that listens for commands from remote clients
Tips
- Use a port number above 1024 to avoid requiring elevated privileges
- Monitor the Clients output to track how many devices are currently connected
- Combine with a JSON Parser node if the incoming data is JSON-formatted
- Sender IP is useful for routing responses back to the correct client when multiple clients are connected
Open TCP Server in the interactive catalog →
TCP Server is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.