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


Using an unsolicited event-exit routine

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

The unsolicited event-exit routine enables an application to specify an event exit routine that is invoked when an unsolicited event occurs. This exit routine can be a part of the program that specifies it, or it can be a separate module. The exit routine must be resident at the time that the EZASMI TYPE=INITAPI macro is issued, and it must stay resident until the EZASMI TYPE=TERMAPI macro is issued.

The user invokes this facility by the issuing the optional UEEXIT parameter that is used in the EZASMI TYPE=INITAPI macro, as shown in the following syntax fragment:

Read syntax diagramSkip visual syntax diagram
>>-+--------------------------+--------------------------------><
   '-,UEEXIT--=--+-address--+-'   
                 +-*indaddr-+     
                 '-(reg)----'     

Keyword
Description
UEEXIT
A double word value that is composed of two positional parameters. The first parameter is the address of the event-exit routine that is invoked when an unsolicited event occurs. The second parameter is the address of the token that is passed to the exit routine. On entry to the unsolicited event-exit routine, the general purpose registers (GPRs) contain the following values:
GPR0
Register setting. The following values are supported:
0
TPC/IP is active
1
TCP/IP is inactive
GPR1
Address of the token that is specified in the INITAPI macro
GPR13
Pointer to a standard MVS™ save area. This save area is in the same key that the application program status word (PSW) was in when the EZASMI TYPE=INITAPI macro was issued.
GPR14
Return address
The following code example shows how the EZASMI TYPE=INITAPI macro can be used to specify an unsolicited event-exit routine (MYUEE). The MYUEE storage definition contains the address of the exit routine, MYUEE1, followed by the address of the user exit token, UETOKEN:
         EZASMI TYPE=INITAPI,     Issue INITAPI Macro                  X
               SUBTASK=SUBTASK,   SPECIFY SUBTASK IDENTIFIER           X
               MAXSOC=MAXSOC,     SPECIFY MAXIMUM NUMBER OF SOCKETS    X
               MAXSNO=MAXSNO,     (HIGHEST SOCKET NUMBER ASSIGNED)     X
               ERRNO=ERRNO,       (Specify ERRNO field)                X
               RETCODE=RETCODE,   (Specify RETCODE field)              X
               APITYPE=APITYPE,   (SPECIFY APITYPE FIELD)              X
               ERROR=ERROR,       ABEND IF ERROR ON MACRO              X
               UEEXIT=MYUEE,                                           X
               ASYNC=('EXIT',MYEXIT)  (SPECIFY AN EXIT)                 

*---------------------------------------------------------------------*
*        UNSOLICITED EVENT EXIT                                        
*---------------------------------------------------------------------*
         CNOP 0,4
MYUEE    DC   A(MYUEE1,UETOKEN)                                        
UETOKEN  DS   F                                                        
MYUEE1   SAVE (14,12),T,*                                              
         LR   R2,R15                                                   
         USING MYUEE1,R2                                               
UEKEY    WTO 'UEEXIT BEING DRIVEN'                                     
         EZASMI TYPE=TERMAPI      Issue EZASMI Macro for Termapi       
         POST ECB,1                                                    
         RETURN (14,12),T,RC=0                                         
         DROP  R2

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014