Each mainframe server application that uses Gateway-Library must initialize the operating environment. Gateway-Library uses two structures to do this:
The IHANDLE structure is a transaction-wide structure that contains configuration parameters and other high-level information used to set up the operating environment for a Gateway-Library transaction. It is defined for each transaction by TDINIT.
TDINIT must be the first Gateway-Library function call in each application. The IHANDLE structure corresponds to the context handle in Open Client Client-Library™.
After the environment is initialized, an application must establish a conversation between the client and the server over one of the predefined connections. In Open ServerConnect, a logical connection is represented by a TDPROC structure. A TDPROC structure is associated with an IHANDLE structure and is defined in TDACCEPT.
The TDPROC structure corresponds to the DBPROCESS structure in DB-Library and to the connection and command handles in Client-Library. Gateway-Library sends commands to the server and returns query results to the application through the TDPROC structure.
The handle for TDPROC is stored in the argument TDPROC. Every Gateway-Library function that sends or accepts data across a connection must specify that connection handle in its TDPROC argument.