![Anybus CompactCom 40 EtherNet/IP Network Manual Download Page 114](http://html1.mh-extra.com/html/anybus/compactcom-40-ethernet-ip/compactcom-40-ethernet-ip_network-manual_2948758114.webp)
114
Doc.Id. HMSI-27-212
Anybus CompactCom 40 EtherNet/IP
Doc.Rev. 1.5
Command Details: Shutdown
Category
Extended
Details
Command Code.:
11h
Valid for:
Instance
Description
This command closes a TCP-connection using the FIN-flag. Note that the response does not indicate
if the connection actually shut down, which means that this command cannot be used to poll non-block-
ing sockets, nor will it block for blocking sockets.
• Command Details
• Response Details
(no data)
The recommended sequence, performed by the application, to gracefully shut down a TCP connection
is described below.
Application initiates shutdown:
1.
Send shutdown with CmdExt[1] set to 01h. This will send FIN-flag to host shutting down the
send channel, note that the receive channel will still be operational.
2.
Receive data on socket until error message Object specific error (EDESTADDRREQ (14)) is
received, indicating that the host closed the receive channel. If host does not close the receive chan-
nel use a timeout and progress to step 3.
3.
Delete the socket instance. If step 2 timed out, RST-flag will be sent to terminate the socket.
A remote host initiates shutdown:
1.
Receive data on socket, if zero bytes received it indicates that the host closed the receive channel
of the socket.
2.
Try to send any unsent data to the host.
3.
Send shutdown with CmdExt[1] set to 01h. This will send FIN-flag to host shutting down the
receive channel.
4.
Delete the socket instance.
Field
Contents
CmdExt[0] (reserved, set to zero)
CmdExt[1] Value:Mode:
00h Shutdown receive channel
01h Shutdown send channel
02h Shutdown both receive- and send channel