Search

Home

Home

OUTPUT TCP

OUTPUT TCP

The OUTPUT TCP operator is used exclusively in projects triggered by a Socket trigger. Its purpose is to generate a message that is sent back to the TCP client—that is, the sender of the message that connected to the TCP server handling the trigger.

This operator allows a response or acknowledgment to be sent directly to the TCP client within the same communication session.

Example of a GRAVITY project using the OUTPUT TCP operator:

image

OPERATOR BEHAVIOR CONFIGURATION

The operator always runs in Single execution mode, meaning it is invoked once for all records on the data bus. If there is more than one record on the data bus, the first record is used depending on the Output data type configuration (for binary and text types when the LOOP … ENDLOOP clause is not used in the Message body field).

  • Output data type → specifies the type of data that will be sent back to the client.
    • Binary → binary data. A data bus bit of type binary containing the data to be sent is required.
    • image
    • Text → text data. The operator prepares the text data based on the Message body field.
  • Message body → a field that allows you to define the message sent back to the TCP client. In the message, you can use manually entered text, project parameters, global variables, and input data bus bits.
image

When using data bus bits to build text, keep in mind that if the data bus contains more than one record, values will be taken only from the first record. If you want the text to be built based on all records, use the LOOP … ENDLOOP clause. The system will process the text inside the markers as many times as there are records on the data bus, substituting bits from the currently processed record.

Example:

The text inside the "LOOP" clause will be generated for each record
LOOP
Delivery_id: %Delivery_id%; store: %store%
ENDLOOP
end of processing