TCP Client
TCP Client writes a payload to the endpoint defined by a TCP Connection, and — depending on Exchange Pattern — reads a reply back.
TCP is a byte stream with no message boundaries of its own, so the Framing tab is what tells the activity where one message ends and the next begins. Choose the frame type the receiving system actually uses; a framing mismatch is the usual cause of a truncated or combined reply.
The payload itself is either UTF-8 text or base64-encoded binary, set by Payload Encoding and overridable per message from the input.
The activity has five tabs: Configuration, Framing, Advanced, Input, and Output.
Configuration
| Field | Required | Description |
|---|---|---|
| Name | Optional | Name of the component. |
| Description | Optional | Description of the component. |
| TCP Connection | Optional | The TCP endpoint resource to send to. |
| Exchange Pattern | Optional | Request / Reply (send then read a reply) or Send Only (fire-and-forget). Defaults to Request / Reply. |
| Payload Encoding | Optional | Text (UTF-8) or Base64 (binary). Defaults to Text (UTF-8). The input may override this. |
Framing
| Field | Required | Description |
|---|---|---|
| Frame Type | Optional | How message boundaries are found on the byte stream. Defaults to Delimiter. |
| Delimiter | Optional | Frame terminator. Defaults to a newline. |
| Include Delimiter | Optional | Keep the delimiter in the returned frame. Defaults to cleared. |
| Fixed Length (bytes) | Optional | Frame size when Frame Type is Fixed length. |
| Length Prefix Size (bytes) | Optional | Width of the length header: 1, 2, 4, or 8. Defaults to 4. |
| Length Byte Order | Optional | Big-endian (network order) or Little-endian. Defaults to Big-endian. |
| Max Frame Size (bytes) | Optional | Hard cap per frame. Defaults to 1048576. |
Frame Type
| Option | Boundary |
|---|---|
| Delimiter | Frames end at the Delimiter character. |
| Fixed length | Every frame is Fixed Length (bytes) long. |
| Length prefix | Each frame is preceded by a length header of Length Prefix Size (bytes). |
| Raw (read until timeout/EOF) | No framing; read until the timeout or end of stream. |
Delimiter defaults to a single newline character. Length Prefix Size (bytes) and
Length Byte Order apply to Length prefix framing, and Fixed Length (bytes) to
Fixed length.
Max Frame Size (bytes) is a hard cap per frame that protects against oversized or hostile length prefixes.
Advanced
| Field | Required | Description |
|---|---|---|
| Fail on Read Timeout | Optional | Fail if no reply arrives within the read timeout. Defaults to selected. |
| Connect Timeout Override (ms) | Optional | Overrides the connection's connect timeout. |
| Read Timeout Override (ms) | Optional | Overrides the connection's read timeout. |
Fail on Read Timeout applies to Request / Reply only. Both overrides replace the
corresponding value on the TCP Connection resource.
Input
| Field | Required | Data Type | Description |
|---|---|---|---|
| payload | Required | String | Bytes to send, interpreted per Payload Encoding. body is accepted as an alias. |
| payloadEncoding | Optional | String | Per-message override of the activity's payload encoding: TEXT or BASE64. contentEncoding is accepted as an alias. |
Output
The activity returns a tcpOutput object.
| Field | Data Type | Description |
|---|---|---|
| sent | Boolean | True once the payload was written. |
| response | String | Reply frame, encoded per responseEncoding. Request / Reply only. |
| responseEncoding | String | Encoding of response: TEXT, or BASE64 when the reply is not valid UTF-8 text. |
| bytesSent | Integer | Number of bytes written. |
| bytesReceived | Integer | Number of bytes read. |
| durationMs | Integer | Round-trip duration in milliseconds. |