Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
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.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
PROTOCOL | Protocol | *UDP, *TCP | Required, Positional 1 |
LCLINTNETA | Local internet address | Character value, * | Required, Positional 2 |
LCLPORT | Local port | 1-65535 | Required, Positional 3 |
RMTINTNETA | Remote internet address | Character value, * | Optional, Positional 4 |
RMTPORT | Remote port | 1-65535, * | Optional, Positional 5 |
Top |
Specifies the protocol used by the connection that is to be ended. The protocol value must be either *TCP or *UDP.
Top |
Specifies the local internet address of the connection to end. This parameter is required for both UDP and TCP.
Top |
Specifies the local port number of the connection to end. This parameter is required for both UDP and TCP. A decimal number identifying a local port must always be specified for this command.
Attention:
Ports 1 through 1024 are reserved for use by system-supplied TCP/IP applications. If the user specifies ports 1 through 1024, it can affect the operation of those applications.
Top |
Specifies the remote internet address of the connection to end. This parameter is required for TCP.
Top |
Specifies the remote port number of the connection to end.
This parameter is required for TCP.
Top |
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.
Top |
*ESCAPE Messages
Top |