SLI_CLOSE
This verb closes the SNA session. SLI_CLOSE terminates the connection with the host application program and frees the resources that were used. The posting of SLI_CLOSE signifies that the LU-LU and the SSCP-LU communications have ended.
Supplied Parameters
- lua_verb
- LUA_VERB_SLI
The verb-code indicator for the LUA verbs.
- lua_verb_length
- The length of the verb control block. This number must equal the length expected by the SLI for the SLI_CLOSE verb.
- lua_opcode
- LUA_OPCODE_SLI_CLOSE
The operation code for SLI_CLOSE.
- lua_correlator
- A value that an LUA application program can supply to help correlate this verb with other information that the program supplies. This parameter is not used by the LUA interface.
- lua_luname
- The local LU name in ASCII. If the name contains fewer than 8 characters, you must pad it with blanks. LUA examines this parameter only if lua_sid is 0. Using the lua_luname parameter on all verbs helps make debugging easier, especially when multiple LUs are configured.
- lua_sid
- The session ID returned by a successfully completed SLI verb that identifies the session to be used. If this parameter is 0, the lua_luname parameter is used for identification.
- lua_post_handle
- This is a 4-byte handle that is used to post the completion of asynchronous verbs.
- lua_flag1.close_abend
- Specifies whether the close is a close immediate (on) or a normal close (off).
Returned Parameters
- lua_flag2.async
- A flag that indicates that this verb completes asynchronously.
- lua_prim_rc
- The primary return code, set by the verb function. For details, see LUA Verb Return Codes.
- lua_sec_rc
- The secondary return code, set by the verb function. For details, see LUA Verb Return Codes.
Usage Notes
There are two types of SLI_CLOSE: close normal and close abend.
- Close Normal
The close normal is identified when the lua_flag1.close_abend parameter is set to 0. The close sequence can be secondary initiated or primary initiated. The close normal uses a SHUTD command for a primary initiated or primary initiated. The close normal uses a SHUTD command for a primary initiated close and sends an RSHUTD command for a secondary initiated close.
If the host sends an UNBIND type X'02' (UNBIND with BIND forthcoming) during a primary or secondary initiated SLI_CLOSE normal, the session is not closed. The SLI_CLOSE verb completes with the CANCELED primary return code, RECEIVED_UNBIND_HOLD secondary return code. The application program should issue an SLI_BID or SLI_RECEIVE verb to return STATUS.
If the host sends UNBIND type X'01' (normal UNBIND) during a primary or secondary initiated SLI_CLOSE Normal and the SLI_OPEN verb for this session specified and lua_session_type of LUA_SESSION_TYPE_DEDICATED, the session is not closed. The SLI_CLOSE verb completes with the CANCELED primary return code and the RECEIVED_UNBIND_NORMAL secondary return code. The application program should issue SLI_BID or SLI_RECEIVE to return STATUS.
- Close Abend
The close abend is identified when the lua_flag.close_abend parameter is set to 1. The CLOSE_ABEND option tells the SLI to end the session immediately.
- SLI_CLOSE Normal
- Secondary Initiated Close
After the SLI application program issues an SLI_CLOSE verb with lua_flag.close_abend set to 0, the SLI performs the following processing:
Writes the RSHUTD command
Reads and processes the RSHUTD command response
Reads and processes the CLEAR command (if required)
Writes the CLEAR command response (if required)
Reads and processes the UNBIND command
Writes the UNBIND command response
Stops the RUI session - Primary Initiated Close
Reads the SHUTD command and gives the application SESSION_END_REQUESTED status.
After the SLI application program issues SLI_CLOSE with lua_flag.close_abend set to 0, the SLI performs the following processing:
Writes the CHASE command
Reads and processes the CHASE command response
Writes the Shutdown Complete (SHUTC) command
Reads and processes the SHUTC command response
Reads and processes the CLEAR command (if required)
Writes the CLEAR command response (if required)
Reads and processes the UNBIND command
Writes the UNBIND command response
Stops the RUI session - SLI_CLOSE Abend
- After the SLI application program issues an SLI_CLOSE verb with lua_flag1.close_abend set to 1, the SLI stops the RUI session.
- Secondary Initiated Close
The completion of the SLI_CLOSE verb implies that the LU-LU session is unbound and that the SSCP was notified of no-session capability for the LU. After the SLI_CLOSE verb completes successfully, no other SLI command can be issued for the session except another SLI_OPEN . All pending commands are terminated when the SLI_CLOSE verb is received.
- Do not use this function to close sessions that are established using the RUI.
- Before you issue an SLI_CLOSE normal, be certain
that all owed responses have been sent to the host. The SLI automatically
changes the CLOSE type to ABEND if responses are owed.
The CLOSE type might be automatically changed to ABEND if the LUA application program ignores data. It is good programming practice to use the SLI_RECEIVE verb to receive all data from the host. Otherwise, the SLI might assume that a response is owed, even if the data was an exception request, and change the CLOSE type to ABEND.