One way to terminate a network connection is to issue the CLOSE call which attempts to complete all outstanding data transmission requests prior to breaking the connection. The SHUTDOWN call can be used to close one-way traffic while completing data transfer in the other direction. The HOW parameter determines the direction of traffic to shutdown.
When the CLOSE call is used, the SETSOCKOPT OPTVAL LINGER parameter determines the amount of time the system will wait before releasing the connection. For example, with a LINGER value of 30 seconds, system resources (including the IMS™ or CICS® transaction) will remain in the system for up to 30 seconds after the CLOSE call is issued. In high volume, transaction-based systems like CICS and IMS, this can impact performance severely.
If the SHUTDOWN call is issued when the CLOSE call is received, the connection can be closed immediately, rather than waiting for the 30-second delay.
If you issue SHUTDOWN for a socket that currently has outstanding socket calls pending, see Table 1 to determine the effects of this operation on the outstanding socket calls.
Authorization: | Supervisor state or problem state, any PSW key. |
Dispatchable unit mode: | Task. |
Cross memory mode: | PASN = HASN. |
Amode: | 31-bit or 24-bit. Note: See "Addressability
mode (Amode) considerations" under CALL instruction API environmental restrictions and programming requirements.
|
ASC mode: | Primary address space control (ASC) mode. |
Interrupt status: | Enabled for interrupts. |
Locks: | Unlocked. |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
Figure 1 shows an example of SHUTDOWN call instructions.
WORKING-STORAGE SECTION.
01 SOC-FUNCTION PIC X(16) VALUE IS 'SHUTDOWN'.
01 S PIC 9(4) BINARY.
01 HOW PIC 9(8) BINARY.
88 END-FROM VALUE 0.
88 END-TO VALUE 1.
88 END-BOTH VALUE 2.
01 ERRNO PIC 9(8) BINARY.
01 RETCODE PIC S9(8) BINARY.
PROCEDURE DIVISION.
CALL 'EZASOKET' USING SOC-FUNCTION S HOW ERRNO RETCODE.
For equivalent PL/I and assembler language declarations, see Converting parameter descriptions.