VARY TCPIP,,DROP

Use the VARY TCPIP,,DROP command to drop a single TCP connection or UDP socket, or to stop all established TCP connections for a specified server. For detailed information about drop processing, see Netstat DRop/-D command.

Restriction: You can use this command only if the MVS™.VARY.TCPIP.DROP security product resource profile is defined and the user ID associated with the DROP command is permitted for CONTROL access to this resource.

For dropping a single TCP connection or UDP socket

You can use this command with the connid or CONNECTION parameters to terminate the specific TCP/IP socket endpoint that is identified by its connection number, connid. You can determine the connection number from the Conn column in the Netstat COnn/-c or Netstat TELnet/-t display. This version of the command is the console environment equivalent of the Netstat DRop/-d commands in the TSO and z/OS® UNIX environments.

When the command is issued against a socket endpoint, any outstanding or subsequent socket calls that refer to the dropped socket terminate with a negative return code. The socket endpoint that you drop can be a listening TCP server socket endpoint, a fully connected TCP socket (either server or client connection endpoint), or a UDP socket endpoint. When you drop a TCP connection or UDP endpoint, the associated socket does not close. The application that owns the associated socket is responsible for closing the socket.

Tips:
  • You can use this command when you do not want to stop the server itself, but only want to drop an individual TCP connection with that server.
  • You can use this command to stop old TCP connections if they prevent a server from being restarted. This is sometimes necessary when the server does not enable the SO_REUSEADDR socket option before binding to its well-known port.

If you want to terminate all socket activities from a specific sockets application, terminate the application by using the appropriate mechanism that is provided by the application. This command can have unpredictable results if it is issued against a listening socket or UDP socket. Some applications might not handle the subsequent socket errors as expected. To drop all connections that are associated with a server application without terminating the listening socket, use the form of the VARY DROP command specifying a PORT or JOBNAME, as described in the following information.

Format

Read syntax diagramSkip visual syntax diagram
>>-Vary --TCPIP--,--+----------+--,--+-DRop,-----+-------------->
                    '-procname-'     '-CMD=DRop,-'   

>--+-connid--------------+-------------------------------------><
   '-CONNection=--connid-'   

Parameters

procname
The identifier of the TCP/IP address space. When the procname value is not specified, there can be only one TCP/IP address space started. If more than one TCP/IP address space is available and no procname value is specified, the request will fail with an error message.
CMD=DRop or DRop
Synonymous syntax for parameter used to drop a connection.
CONNection=connid or connid
The connid value is a required parameter. It can be specified by itself or as the value of the CONNECTION parameter. Issue the Netstat COnn/-c command or the DISPLAY TCPIP,,NETSTAT,CONN command to obtain the connection identifier for the TCP/IP socket connection that you want to drop.

For dropping all TCP connections associated with a TCP/IP server

You can drop all TCP connections associated with a TCP/IP server using the VARY TCPIP,,DROP command by specifying filter parameters to identify the server whose TCP connections are to be terminated. If more than one server matches the filter criteria, you must specify additional parameters (for example, JOBNAME and ASID) to identify which TCP connections of the server will be dropped. When a TCP connection is dropped, the associated socket does not close. The application that owns the associated socket is responsible for closing the socket. The following message is issued to indicate that the command has completed processing:
EZD2013I numconn  CONNECTIONS WERE  SUCCESSFULLY DROPPED 

Tip: Shut down the server before issuing this command to prevent new connections from using this server. For Sysplex Distributor connections, you can issue a VARY TCPIP,,SYSPLEX,QUIESCE command. For Load Balancing Advisor (LBA) connections, issue a MODIFY LBAGENT,QUIESCE command.

Format:

Read syntax diagramSkip visual syntax diagram
>>-Vary --TCPIP--,--+----------+--,--+-DRop,-----+-------------->
                    '-procname-'     '-CMD=DRop,-'   

>--+-POrt=portnum--+----------------------------------+-+------><
   |               '-,JOBNAME=jobname--+------------+-' |   
   |                                   '-,ASID=asid-'   |   
   '-JOBNAME=jobname--+------------+--------------------'   
                      '-,ASID=asid-'                        

Parameters:
procname
The identifier of the TCP/IP address space. When the procname value is not specified, there can be only one TCP/IP address space started. If more than one TCP/IP address space is available and no procname value is specified, the request will fail with an error message.
CMD=DRop or DRop
Synonymous syntax for parameter that is used to drop a connection.
POrt=portnum
The port number parameter is an integer in the range 1- 65535.

Servers that are bound to this port number will have all their TCP connections reset. If the portnum value specifies a port that has more than one instance of a server bound to it with either a different jobname or asid value, then either the JOBNAME value, or the JOBNAME and ASID values must be specified to identify a unique server instance for which connections will be dropped.

JOBNAME=jobname
The jobname value specifies the MVS job name of the server with which the Drop command is to be associated.
  • If the JOBNAME parameter is specified without the PORT keyword, then all servers with this jobname value will have their TCP connections dropped regardless of the port they are bound to.
  • If the jobname value specifies a job name that has more than one instance of a server with that job name but that has a different asid value, then the ASID parameter must also be specified and all server instances that have a matching job name and address space ID will have their TCP connections dropped, regardless of the port they are using.
  • The environment in which the server runs determines the job name that is to be associated with a particular server application.
  • The jobname value can be up to 8 characters in length.
ASID=asid
The asid value specifies the hexadecimal address space ID associated with the server whose TCP connections are to be dropped. If more than one instance of that application is found and the jobname value is not unique, you must specify an asid value to drop TCP connections for all server instances that match this job name and asid value.

Examples

The following examples are about dropping TCP/IP socket connections.

  • The first example is directed to a TCP/IP address space started by the identifier TCPPROC and demonstrates how to drop a TCP connection number 5001:
    VARY TCPIP,TCPPROC,CMD=DROP,CONNECTION=5001
  • The next example assumes there is only one TCP/IP address space and demonstrates how to drop a UDP connection number 6001:
    VARY TCPIP,,CMD=DROP,CONNECTION=6001
  • This example indicates how to drop all the TCP connections associated with a server listening on port 75, with job name JOBSRVR1:
    VARY TCPIP,,CMD=DROP,PORT=75,JOBNAME=JOBSRVR1
  • This example indicates how to drop all the TCP connections associated with a server listening on port 75, with job name JOBSRVR1 in address space 15:
    VARY TCPIP,,CMD=DROP,PORT=75,JOBNAME=JOBSRVR1,ASID=15
  • This example indicates how to drop all the TCP connections associated with a server with job name JOBSRVR1 in address space 15, regardless of port:
    VARY TCPIP,,CMD=DROP,JOBNAME=JOBSRVR1,ASID=15