When messages are sent to socket partners, each message segment or fragment must be sent by means of a separate MPUT NT/NE call. At each MPUT call, a separate message segment is created, even if zero is specified as the length. A message with a length of zero is only sent, however, if a USP header is created automatically for the message to be sent and is placed in front of it (see the table below). The exception is that if the program unit contains only one MPUT call, no message is sent, regardless of the value of the USP-HDR parameter.
If the socket partner expects a USP header when it receives a message then you can define during generation that openUTM should automatically create a USP header for messages to the socket partner and precede them with this header.
This is specified at generation using the USP-HDR= operand in the PTERM or TPOOL statement:
for all messages, i.e. K messages + MPUT/FPUT messages (USP-HDR=ALL)
for K messages only (USP-HDR=MSG)
no header (USP-HDR = NO)
If no code conversion has been generated for the socket partner (MAP=USER operand in the PTERM or TPOOL statement), you can also generate the USP header in the program unit itself and prefix it to the message.
For information on generating sockets applications, please refer to the openUTM manual “Generating Applications”
Exchanging long messages
Input messages and dialog output messages of any length can be exchanged with socket partners. If an entire message is longer than 32767 bytes (output) or 32000 bytes (input), the message must be fragmented (i.e. it must consist of several message segments). The maximum length of each message segment is 32767 bytes (including the USP header) at output and 32000 bytes at input.
Message segments can be identified by the fact that the relevant flag field and the corresponding message type in the USP header are set (see below). In the case of outputs, the program must set these values.
Fragmented input messages must be read using a corresponding number of MGET/FGET/DGET NT calls (see "Communication via socket connections"). Fragmented dialog output messages must be sent using a corresponding number of MPUT NT calls.
Asynchronous output messages (FPUT/DPUT) cannot be fragmented. Their length must not exceed 32700 bytes.