CL Command Reference - ENDTCPCNN

CL Command List > ENDTCPCNN Reference

Description:

The End TCP/IP Connection (ENDTCPCNN) command is used to end a Transmission Control Protocol/Internet Protocol (TCP/IP) connection. This command ends a connection immediately and should be used only when a normal end is not possible.

Note: The ENDTCPCNN command is usually used by specifying option 4 on the Work with TCP/IP Connection Status list of the WRKTCPSTS (NETSTAT) display. The ENDTCPCNN command is provided as a separate command to give system administrators control over this function. By limiting the authority to the ENDTCPCNN command, the system administrator limits which users can end TCP/IP connections without restricting access to the NETSTAT utility.


Examples:

Example 1: Ending a TCP Connection

ENDTCPCNN PROTOCOL(*TCP) LCLINTNETA(กฏ9.5.1.109กฏ) LCLPORT(13054)
RMTINTNETA(กฏ9.130.28.144กฏ) RMTPORT(23)

This command ends the TCP connection between local port 13054 for local internet address 9.5.1.109 and remote port 23 for remote internet address 9.130.28.144. The TCP/IP protocol stack ends all activity on the connection and returns the resources to the free storage pools.



Example 2: Closing a UDP Socket

ENDTCPCNN PROTOCOL(*UDP) LCLINTNETA(กฏ9.130.28.144กฏ)
LCLPORT(596)

This command closes the UDP socket using local port 596 and local internet address 9.130.28.144. The TCP/IP protocol stack ends all activity on the connection and returns the resources to the free storage pools.



Example 3: Ending a LISTEN State TCP Socket

ENDTCPCNN PROTOCOL(*TCP) LCLINTNETA(*) LCLPORT(5023)
RMTINTNETA(*) RMTPORT(*)

This command ends the TCP socket that is listening on local port 5023. The application that created this socket did not specify a local internet address. The socket is closed and the local port is made available for use by another application.