TCP/IP Processing UDR Types

TCP/IP Processing UDR Types

You can view the UDR types used by the TCP/IP processing agent in the UDR Internal Format Browser. To access it, follow these steps:

  1. Click Build in the menu.

  2. Select New Configuration.

  3. Choose APL Code.

  4. In the editing area, right-click and select UDR Assistance. This will open the UDR Internal Format Browser.

TCPIP_FW_UDRs.png
TCP/IP UDR

RemoteHostConfig

The RemoteHostConfig UDR contains the connection details for the remote host. This UDR is included in all the other UDR types.

The following fields are included in the RemoteHostConfig:

Field

Description

Field

Description

host (string)

This field contains the hostname or IP address of the remote host.

port (int)

This field contains the port to the remote host.

connections per destination (int)

This field contains the required number of connections towards the remote host and port. The default is 1 connection per destination.

ConnectionRequestUDR

This is required only if the connection has to be established/disconnected at runtime and is not mentioned in the agent table.

When the agent receives this UDR, it tries to establish a new connection or close a connection to a remote host. The agent then returns the ConnectionStateUDR with information about the current state of the connection.

The following fields are included in the ConnectionRequestUDR:

Field

Description

Field

Description

closeConnection (boolean)

This field determines whether the request is for opening or closing a connection. For a new connection, this field is set to false, and to close the connection, this field is set to true.

remoteHost (RemoteHostConfig (TPCIP))

This is the RemoteHostConfig UDR that contains the connection details.

ConnectionStateUDR

The agent returns the ConnectionStateUDR when a ConnectionRequestUDR has been sent, and if a connection goes down.

The following fields are included in the ConnectionReqeustUDR:

Field

Description

Field

Description

connectionOpen (boolean)

If the connection is valid (see the validAddress field below), this field indicates if the connection is open or not (true = open and false = closed).

remoteHost (RemoteHostConfig (TPCIP))

This is the RemoteHostConfig UDR that contains the connection details.

validAddress (boolean)

This field indicates if the connection details in the RemoteHostConfig UDR are valid (true = valid and false = invalid).

RequestUDR

When the agent receives a RequestUDR, it tries to send the included bytearray to the remote host.

The following fields are included in the RequestUDR:

Field

Description

Field

Description

data (bytearray)

This field contains the actual data to be sent.

remoteHost (RemoteHostConfig (TPCIP))

This is the RemoteHostConfig UDR that contains the connection details.

If this field is not updated, it will broadcast

ResponseUDR

If the TCP/IP processing agent is configured to handle responses, it returns ResponseUDRs to the workflow.

The following fields are included in the ResponseUDR:

Field

Description

Field

Description

data (bytearray)

This field contains the response.

remoteHost (RemoteHostConfig (TPCIP))

This is the RemoteHostConfig UDR that contains the connection details.

Note!
The TCP/IP processing agent uses an internal buffer to limit the maximum size of each response. If a response exceeds 1024 bytes, it may be split into multiple UDRs. When this occurs, the agent automatically increases the buffer size incrementally for subsequent responses.

ErrorUDR

The agent returns the ErrorUDR in case a RequestUDR and ConnectionRequestUDR fail.

The following fields are included in the ErrorUDR:

Field

Description

Field

Description

data (bytearray)

This is original data from the RequestUDR. This can be used to store the data.

ErrorReason (string)

This field contains the reason for the failure.

ErrorStackTrace (string)

This field contains the stack trace from the failure. Note! This field should only be read if necessary, since it requires a large amount of CPU.

remoteHost (RemoteHostConfig (TPCIP))

This is the RemoteHostConfig UDR that contains the connection details.

Note!
The ErrorUDR type is a subtype of the ResponseUDR type. This means that if, for example, instanceOf(input,ErrorUDR) evaluates to true, then instanceOf(input,ResponseUDR) also evaluates to true. See the example below.

Example - Handling ErrorUDRs in APL

consume { //ErrorUDR is a subtype of ResponseUDR if (instanceOf(input, ResponseUDR) && (!instanceOf(input,ErrorUDR)) ) { //ResponseUDR //If you omit the second condition above, and if the input type is ErrorUDR, //the if-statement below will not be evaluated. } else if (instanceOf(input, ErrorUDR) ) { //ErrorUDR } }