Omron CS CJ1W-ETN21 User Manual

Page 180

Advertising
background image

156

Precautions in Using Socket Services

Section 6-9

• Data can remain in a buffer at the local node if the remote TCP socket

closes during communications. Any data remaining in the buffer will be
discarded when the TCP socket is closed. To avoid problems of this
nature, steps will have to be taken in the application program, such as
sending data to enable closing, and then only closing once reception of
this data has been confirmed.

• When closing a connection for a TCP socket, the first port to be closed

cannot be reopened for at least 60 seconds after the other port closes.
However, this restriction does not apply for a port opened using the TCP
ACTIVE OPEN REQUEST command with a local TCP port number of 0
(port number automatically assigned) which is closed from the side that
actively opened the socket.

• A connection is established for a passively opened socket by actively

opening it from another socket. A connection will not be established by a
different socket attempting to actively open the socket that is already
actively opening a socket. Similarly, a connection will not be established if
a different socket attempts to passively open a socket that is already
being passively opened by another socket. You cannot actively open mul-
tiple connections to a socket passively opened at the Ethernet Unit.

• The Ethernet Unit TCP sockets have no KEEP ALIVE function to check

that the connection is normal if communications do not occur for a set
time period through a communications line for which a connection has
been established. The Ethernet Unit’s TCP sockets make no checks to
the socket at the other node. Checks made by the remote node, however,
are received as responses, so that it is not necessary for the user pro-
gram to consider the KEEP ALIVE function.

6-9-4

Precautions in Using Socket Service Request Switches

• Send and reception processing can not be performed at the same time

when Socket Service Request Switches are used for socket services
because there is only one Socket Service Parameter Area for each
socket. For example, if the Send Request Switch is turned ON when data
is being received, the response code will be 110C hexadecimal, indicating
that a Request Switch was turned ON during communications processing.
(The response code for the reception will overwrite this code when pro-
cessing has been completed.)

• If more than one Request Switch is turned ON simultaneously, the

response code will be 110C hexadecimal and all requested processing
will end in an error.

• Close processing can be performed, however, even during open, send, or

receive processing. This enables emergency close processing. Also, the
only parameter required for close processing is the socket number, so a
socket can be closed even when parameters are set for another process.

Advertising