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

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

2.5.5 Notes on using the TCP/IP communication facility

This subsection provides notes on using the TCP/IP communication facility.

Organization of this subsection
(1) Sending messages
(2) Receiving messages
(3) Other notes

(1) Sending messages

(a) Loss of a message in the event of an error

If an error event as described below occurs, the TP1/Client cannot detect a message loss. The user should assign serial numbers to messages so that any message loss can be detected. However, if the message delivery confirmation facility is used, processing in the CUP that assigns serial numbers is not required because TP1/Client manages message serial numbers.

(b) Establishing a connection

TP1/Client acts as a client and sends a message to an MHP. TP1/Client establishes a connection to the MHP. When the MHP uses TP1/NET/TCP/IP, a server type connection is established.

(2) Receiving messages

(a) Loss of a message in the event of an error

If an error event as described below occurs, the TP1/Client cannot detect a message loss. The user should assign serial numbers to messages so that any message loss can be detected. However, if the message delivery confirmation facility is used, processing in the CUP that assigns serial numbers is not required because TP1/Client manages message serial numbers.

(b) Checking received messages

A message from any MHP can be received. When receiving a request to establish a connection, a CUP accepts it unconditionally and receives a message. By including a header with the message identifier in each message, the user must check whether the message is to be received by the CUP.

(c) Message length

Messages are received using the TCP/IP protocol.

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. However, if the message assembly facility or message delivery confirmation facility is used, this processing need not be implemented in the CUP because TP1/Client manages the message length.

If the received message is shorter than the specified message length, TP1/Client considers the message is divided. Therefore, it does not return control to the CUP until the message of the specified length is received.

(d) Establishing a connection

TP1/Client acts as a server and receives a message from an MHP.

The MHP establishes a connection to TP1/Client. When the MHP uses TP1/NET/TCP/IP, a client type connection is established.

(3) Other notes

The following provides notes on using the message assembly facility and the message delivery confirmation facility in TP1/NET/TCP/IP. If you use the message assembly facility and message delivery confirmation facility in TP1/Client, you can skip these notes.

For details about the protocol-specific definitions for TP1/NET/TCP/IP, see the manual OpenTP1 Protocol TP1/NET/TCP/IP.

(a) Message assembly facility in TP1/NET/TCP/IP

In TP1/NET/TCP/IP, when you use the message assembly facility, a four-byte message length is added to the beginning of the data sent by an MHP. When you send data to an MHP, you must specify the message length in the first four bytes. The message length must be in the network byte order. The message length is deleted when the MHP receives the message. Note that you must mind the message length when sending or receiving messages to or from CUPs.

(b) Message delivery confirmation facility in TP1/NET/TCP/IP

When the message delivery confirmation facility is used in TP1/NET/TCP/IP, 11-byte message information is prefixed to data sent by the MHP. When TP1/Client receives the data, it sends response-only data. (Note that 11-byte message information must also be prefixed to the data to be sent to the MHP.) After the MHP sends the data, it waits to receive the response-only data.

Ensure that the network byte order is used for the message length information in the message information prefixed to the send data. When the MHP receives a message, the message length information is deleted. However, the CUP must set the message information while sending and receiving data.