FCT_CLOSE: Deletes the Specified Socket
(Original Document)
Function Description
The FCT_CLOSE function deletes the specified socket.
NOTE: If the socket number is not indicated or is 0, all open sockets are deleted.
As the sockets were opened with the SO_LINGER option when using FCT_SOCKET, the FCT_CLOSE function is not blocked, even if the queues have not yet been sent or been acknowledged. This is called a hard or abortive close, because the socket's virtual circuit is reset immediately, and any unsent data is lost.
Any call to the FCT_RECEIVE function to the other side of the circuit will fail with the error message: connection reset (16#36).
The additional parameters EN and ENO may be configured.
Representation in FBD
Representation in LD
Representation in IL
LD Module_Number
FCT_CLOSE Socket_Number, Gest_Index, Management_Param
Representation in ST
FCT_CLOSE(Module_Number, Socket_Number, Gest_Index, Management_Param);
Description of Parameters
The following table describes the input parameters:
Parameter
Type
Comment
Module_Number
Slot number of network module in rack 0.
  • Low byte is the slot number of network module in rack 0.
  • High byte can be used to extend the number of sockets.
    • 00: Provided for full backward compatibility with applications created on firmware version 3.3 or earlier.
    • 01: Up to 64 sockets can be used (firmware version must be higher than 3.3).
Socket_Number
Number of socket to be deleted. If the value of the Socket_Number is 0, all sockets are deleted.
Gest_Index
Index of first word in Management_Param array
The following table describes the input/output parameters:
Parameter
Type
Comment
Management_Param
ARRAY [0... 3] OF INT
The operation report can have the following values:
  • 16#00: No error.
  • 16#16: The socket number is invalid.