Read TCP Data
Read TCP Data is an asynchronous activity that reads data from an open TCP connection. The connection must be opened by an activity or a process starter that executed previously in the process.
General
Activities that can open a TCP connection are: TCP Receiver, TCP Open Connection, and Wait for TCP Request. The activity that opens a TCP connection places a handle to the open connection in its connectionKey output element. The connectionKey is mapped to this activity’s input.The General tab has the following fields.
Input
The following is the input for the activity.
Input Item | Datatype | Description |
---|---|---|
connection | binary | The handle to the connection to read the data from.
This connection is obtained from a previously executed activity in the process that opened the connection. |
encoding | string | Specifies the character encoding of the text when reading the text data.
This value overrides the value specified in the Encoding field in the General tab. |
separator | string | An optional element. Specifies the boundary between the body elements after writing the body element to the TCP connection, while reading the text data.
This element is available only when the User Defined Separator option is selected on the General tab. This value overrides the value specified in the General tab. |
bytesToRead | number | An optional element. Specifies the number of bytes to be read when reading the binary data.
This value overrides the value specified in the Bytes To Read field in the General tab. |
timeout | number | An optional element. The time to wait (in milliseconds) for this activity to complete. |
Output
The following is the output of the activity.
Output Item | Datatype | Description |
---|---|---|
data | string | When the data is specified as text, this output element contains the text read from the TCP connection. The separator character if specified, is not included in the output.
When the data is specified as binary, this output element contains the binary data read from the TCP connection. |
endOfStreamReached | boolean | This element is set to
true, when the end of the data stream is reached.
This is useful when the activity is in an iteration loop and the activity is configured to read a number of bytes with each iteration. Use this element in the condition of the loop, to determine when the last set of bytes was read. |