z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


TERMINATE

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

Use the TERMINATE command to close all sockets in the specified socket set and to release the socket set.

A socket set is a number of preallocated sockets available to a single application. You can define multiple socket sets for one session, but only one socket set can be active at a time. When the active socket set is released, the next socket set in the stack becomes the active socket set.

Format

Read syntax diagramSkip visual syntax diagram
>>-SOCKET--(--"TERMINATE"--+--------------+--)-----------------><
                           '-,--subtaskid-'      

Parameters

subtaskid
An optional parameter that specifies the name of the socket set. If this parameter is not specified, then the active socket set is released.

Returned value

The command returns a string that contains the return code and the name of the socket set, for example, 0 MYTASKID. The return code can be 0 or the REXX API error number. The return code 0 indicates that the requested socket command was completed successfully.

See Socket call error return codes for additional information about the numeric error codes that are returned by this command.

The following REXX socket API error numbers can be returned:
  • 2001 EINVALIDRXSOCKETCALL
  • 2005 ESUBTASKNOTACTIVE

LE C/C++ equivalent

This command has no LE C/C++ equivalent.

Code example

Figure 1. TERMINATE command example
/* REXX EZARXR30 */
/*
 * This sample demonstrates the use of the TERMINATE
 * socket command.
 */
src = socket("INITIALIZE","MYSET01",10);
if word(src,1) = 0 then say "INITIALIZE SUCCESSFUL";
src = socket("TERMINATE", "MYSET01");
say "TERMINATE = " src;
exit 0;

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014