Skip to main content

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

FieldRequiredDescription
NameOptionalName of the component.
DescriptionOptionalDescription of the component.
TCP ConnectionOptionalThe TCP endpoint resource to send to.
Exchange PatternOptionalRequest / Reply (send then read a reply) or Send Only (fire-and-forget). Defaults to Request / Reply.
Payload EncodingOptionalText (UTF-8) or Base64 (binary). Defaults to Text (UTF-8). The input may override this.

Framing

FieldRequiredDescription
Frame TypeOptionalHow message boundaries are found on the byte stream. Defaults to Delimiter.
DelimiterOptionalFrame terminator. Defaults to a newline.
Include DelimiterOptionalKeep the delimiter in the returned frame. Defaults to cleared.
Fixed Length (bytes)OptionalFrame size when Frame Type is Fixed length.
Length Prefix Size (bytes)OptionalWidth of the length header: 1, 2, 4, or 8. Defaults to 4.
Length Byte OrderOptionalBig-endian (network order) or Little-endian. Defaults to Big-endian.
Max Frame Size (bytes)OptionalHard cap per frame. Defaults to 1048576.

Frame Type

OptionBoundary
DelimiterFrames end at the Delimiter character.
Fixed lengthEvery frame is Fixed Length (bytes) long.
Length prefixEach 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

FieldRequiredDescription
Fail on Read TimeoutOptionalFail if no reply arrives within the read timeout. Defaults to selected.
Connect Timeout Override (ms)OptionalOverrides the connection's connect timeout.
Read Timeout Override (ms)OptionalOverrides 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

FieldRequiredData TypeDescription
payloadRequiredStringBytes to send, interpreted per Payload Encoding. body is accepted as an alias.
payloadEncodingOptionalStringPer-message override of the activity's payload encoding: TEXT or BASE64. contentEncoding is accepted as an alias.

Output

The activity returns a tcpOutput object.

FieldData TypeDescription
sentBooleanTrue once the payload was written.
responseStringReply frame, encoded per responseEncoding. Request / Reply only.
responseEncodingStringEncoding of response: TEXT, or BASE64 when the reply is not valid UTF-8 text.
bytesSentIntegerNumber of bytes written.
bytesReceivedIntegerNumber of bytes read.
durationMsIntegerRound-trip duration in milliseconds.