OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/J

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

2.4.2 Unidirectional receiving of messages

A CUP can receive messages sent from an MHP. This is called unidirectional receiving of messages.

To use the TCP/IP protocol to receive a message from an MHP, the CUP executes the cltReceive method.

The TCP/IP protocol separates each message into multiple packets and packs multiple messages into a single packet. This means that the end of the received message must be determined based on the message length the user specifies. A user initially receives a fixed-length header that includes the message length, and then specifies the message length included in the header to receive the actual message.

When a message whose length is less than the specified message length is received, TP1/Client/J assumes that the message has been segmented, and does not return control to the CUP until it receives the portion of the message that remains as specified by the message length. If a timeout or error occurs, the message can be recovered up to the point of the error, even if the length of the message received is less than the specified message length. However, the user is responsible for assembly of the message from that point.

To enable unidirectional receiving of messages, you must preset the following specifications in the TP1/Client/J environment definition:

The following figure shows unidirectional message reception.

Figure 2-19 Unidirectional receiving of a message

[Figure]

The following figure shows unidirectional message reception in the event of a failure.

Figure 2-20 Unidirectional receiving of a message when an error occurs

[Figure]