Skip to content

The Transmission Control Protocol (TCP) provides a bidirectional byte stream over IP. Tenzir provides operators for both sides of a TCP conversation: connecting to remote endpoints, accepting incoming connections, and serving data to connected clients.

ServerconnectSend (listen)Clienttcp://1.2.3.4Send (connect)tcp://1.2.3.4tcp://5.6.7.8tcp://5.6.7.8Receive (connect)Receive (listen)

Use the IP address 0.0.0.0 to listen on all available network interfaces.

Use from_tcp to connect to a remote TCP endpoint as a client and read data from it, or to_tcp to send data to a remote endpoint. Both operators reconnect automatically with exponential backoff on connection failure.

Use accept_tcp to listen on a local endpoint and accept incoming TCP connections. Each connection spawns a nested pipeline that processes the incoming byte stream independently.

Use serve_tcp to start a TCP server that broadcasts pipeline output to all connected clients. A nested pipeline serializes events into bytes before sending.

See Get data from the network for practical examples.

All TCP operators support TLS via the tls option. Pass an empty record (tls={}) for defaults, or provide specific options like certfile and keyfile. like certfile and keyfile.

Last updated: