ENDTCP (End TCP/IP)

ENDTCP Command syntax diagram

 

Purpose

The End TCP/IP (ENDTCP) command ends TCP/IP processing.

Attention:

There is no confirmation display shown when ENDTCP is entered. The ENDTCP command must be used carefully. When it is used, it ends all TCP/IP processing on the iSeries 400 that you are working on.

If OPTION(*IMMED) is specified for the ENDTCP command, the following is true:

If OPTION(*CNTRLD) is specified for the ENDTCP command, the following is true:

 

Optional Parameters

OPTION
Specifies whether TCP/IP processing is ended in an immediate or controlled manner.

*IMMED: TCP/IP processing is ended immediately.

Attention:

The ENDTCP OPTION(*IMMED) command should be used carefully. Partially updated data may result if an application is processing data and has not completed an operation when the ENDTCP *IMMED command is issued. It is suggested that you do the following:

  • Notify all users before issuing the ENDTCP command so that they can end their applications.
  • Issue the ENDTCP command at a time when you know no TCP/IP traffic is occurring on the iSeries 400. To display the current TCP/IP traffic on the iSeries 400, use option 3 on the Work with TCP/IP Status (WRKTCPSTS or NETSTAT) command.

*CNTRLD: TCP/IP processing is ended in a controlled manner. Applications using TCP/IP are given time to complete their processing. New application processing is not allowed. After the specified period of time elapses, the processing for ENDTCP OPTION(*IMMED) is performed.

The controlled end processing does not do any of the following:

  • It does not monitor to see if all TCP/IP processing has completed before the specified period of time has elapsed.
  • It does not notify an application that is actively using a TCP/IP connection that TCP/IP processing will be ended.

DELAY
Specifies the amount of time (in seconds) allowed in which to complete a controlled end of TCP/IP processing. After this period of time all TCP/IP processing is ended immediately.

delay-time: Specify the number of seconds in which the end operation is completed. Valid values range from 1 through 86400 seconds.

ENDSVR
Specifies whether or not all TCP/IP application server jobs are ended when the End TCP/IP (ENDTCP) command ends TCP/IP processing.

Caution: Before specifying *NO for this parameter, please consider the following:

  • It is not possible to end all the TCP/IP processing on your system without affecting the applications which use TCP/IP.
  • If TCP/IP processing is ended and no form of TCP/IP emulation (such as AnyNet) is active, then TCP/IP applications which are not restarted will not function correctly.
  • Applications that use the Pascal API must always be ended and restarted whenever TCP/IP processing is ended and restarted.

*YES: The ENDTCP command ends all TCP/IP application servers prior to ending TCP/IP processing.

*NO: The ENDTCP command does not end any TCP/IP application server jobs when it ends TCP/IP processing.

Note: ENDTCP ENDSVR(*NO) can be used to end TCP/IP processing without disturbing the operation of jobs using AnyNet. TCP/IP processing will be ended, however TCP/IP application servers that are using AnyNet will continue to function.

If both TCP/IP and AnyNet are inactive, use the End TCP/IP Server (ENDTCPSVR) command to end TCP/IP application server jobs.

Examples for ENDTCP

Example 1: Ending TCP/IP Immediately

ENDTCP *IMMED

This command ends all TCP/IP processing on the iSeries 400 immediately.

Example 2: Ending TCP/IP in a Controlled Time

ENDTCP   OPTION(*CNTRLD)   DELAY(120)

This command ends all TCP/IP processing after 120 seconds have expired. During this time, new TCP/IP processing is not allowed.

Example 3: Ending TCP/IP Immediately Without Ending Application Servers

ENDTCP  *IMMED   ENDSVR(*NO)

This command ends all TCP/IP processing on the iSeries 400 immediately. However, any TCP/IP application servers (FTP, SMTP, and so on) that are active are not ended when TCP/IP processing is ended.

Error messages for ENDTCP

*ESCAPE Messages

TCP1A13
Another job is starting or ending TCP/IP or IP over SNA.
TCP1A70
&1 not active.
TCP1A72
TCP/IP already ending with *CNTRLD option.
TCP1A73
Internal object damaged.
TCP1A74
Error occurred submitting job.
TCP1A77
&1 completed successfully; however errors occurred.
TCP9999
Internal system error in program &1.