INITAPI

The INITAPI call connects a program to the debugging tools sockets interface. All sockets programs must issue the INITAPI call before they issue other sockets calls.

Example of INITAPI call

SOC_FUNCTION DC   CL16'INITAPI'
MAXSOC       DS   H
IDENT        DS   0CL16
TCPNAME      DS   CL8
ADSNAME      DS   CL8
SUBTASK      DS   CL8
MAXSNO       DS   F
ERRNO        DS   F
RETCODE      DS   F
 
             CALL DFHSOKET,(SOC_FUNCTION,MAXSOC,IDENT,SUBTASK,MAXSNO,ERRNO,RETCODE)

Input parameters

SOC_FUNCTION
A 16-byte character field containing INITAPI. The field is left-justified and padded on the right with blanks.
MAXSOC
A halfword binary field set to the maximum number of sockets this program will ever have open at one time. The maximum number is 2000 and the minimum number is 50. This value is used to determine the amount of memory that will be allocated for socket control blocks and buffers. If fewer than 50 sockets are requested, MAXSOC defaults to 50.
Note: This is not the same as the MAXSOCKETS system initialization parameter.
IDENT
A structure containing the identities of the address space and the calling program’s address space. Specify IDENT on the INITAPI call from an address space.
TCPNAME
Reserved — do not specify a value in this field.
ADSNAME
An 8-byte character field. Specify the name of the CICS® startup job.
SUBTASK
Specify a null value (X'00000000') for this parameter.

Output parameters

MAXSNO
A fullword binary field that contains the highest socket number assigned to this program. The lowest socket number is zero. If you have 50 sockets, they are numbered from 0 to 49. If MAXSNO is not specified, the value for MAXSNO is 49.
ERRNO
A fullword binary field. If RETCODE is negative, the field contains an error number. See Return codes for information about ERRNO return codes.
RETCODE
A fullword binary field that returns one of the following:
Value
Description
0
Successful call
-1
Check ERRNO for an error code


dfhtn0v.html | Timestamp icon Last updated: Monday, 5 June 2017