OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P

[Contents][Index][Back][Next]

2.5.2 Receive-only messages

A CUP receives messages sent from an MHP. This type of message is called a receive-only message.

The CUP issues the dc_clt_receive_s function to receive messages from the MHP using the TCP/IP protocol. The CUP issues the dc_clt_assem_receive_s function to use the message assembly facility or message delivery confirmation facility.

The TCP/IP protocol divides a single message into multiple packages or packs multiple messages into a single packet. TP1/Client determines the end of a received message based on the message length specified by the user. The user must receive the header containing the message length and, on the basis of it, receive the actual message length. Note that the CUP does not need to implement these operations when using the message assembly facility or message delivery confirmation facility.

If the received message is shorter than the specified message length, TP1/Client considers the message is divided. TP1/Client does not return control to the CUP until the specified length of message data has been received. However, if a timeout or error occurs before the specified length of message data can be received and the dc_clt_receive_s function is issued, TP1/Client discards the message data that has been received. On the other hand, if the dc_clt_receive2_s or dc_clt_assem_receive_s function is issued, TP1/Client can return control to the CUP without discarding the message data that has been received so far. Using these functions, you can reserve a received message that does not reach the specified length due to an error. You are responsible for reconstructing incompletely received messages.

Before receive-only messages can be received, the applicable CUP port number (port number specified in the oportno operand of the mcftalccn definition command in the MCF communication configuration definition) must be specified in DCRCVPORT of the client environment definition. It is also necessary to issue the dc_rpc_open_s function with DCCLT_ONEWAY_RCV specified in the flags.

The following figure shows the processing of receive-only messages.

Figure 2-19 Processing of receive-only messages

[Figure]

The following figure shows the processing of receive-only messages if an error occurs.

Figure 2-20 Processing of receive-only messages if an error occurs

[Figure]