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 ran previously in the process.
General
The General tab has the following fields.
Field | Literal Value/Module Property/Process Property | Description |
---|---|---|
Name | None | The name to be displayed as the label for the activity in the process. |
Type | None | Type of data to be read. This can be either
Text or
Binary.
Specifying Text in this field enables the Separator and Encoding fields. When Binary is specified, the Bytes To Read field is enabled. |
Separator | Yes | The type of separator. This activity reads data from the TCP connection until the separator or the end of the data stream is encountered.
Select User-defined binary separator (specify comma-separated byte values) from the drop-down list to enable the User Defined Separator field. |
User-Defined Separator | Yes | This field specifies the separator character to use.
When Binary is selected in the Type field, a user-defined separator can be:
|
Encoding | Yes | Specifying Text in the Type field, determines the character encoding of the text data in this field. |
Bytes To Read | Yes | Specify the number of bytes to be read by this activity.
This field is enabled when you select Binary in the Type field. Leaving this field blank makes the activity read until the end of the data stream is encountered. |
Timeout (msec) | Yes | The time to wait (in milliseconds) for this activity to complete. |
Description
Provide a short description for the Read TCP Data activity.
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 ran 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. |
Fault
The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective action to take, see the TIBCO BusinessWorks Container Edition Error Codes.
Fault | Generated When.. |
---|---|
TCPActivityFault | There is some problem associated with the activity at runtime. |