Client-Library uses handles at three levels. Each handle defines and manages a particular environment. Each type of handle can have certain properties, listed below.
Most Client-Library functions include a handle argument.
An application must allocate these handles before using them as
arguments.
The following handles are used with Client-Library:
Context handle. A context handle defines a particular application, context, or operating environment. The context handle is defined in the program’s cs_ctx_alloc call.
An application can have only one context.
A context handle corresponds to the IHANDLE structure in the Open ServerConnect Gateway-Library.
The context handle can have the following properties listed in Table 2-11.
Property |
Set by |
---|---|
CS_EXTRA_INF |
cs_config |
CS_LOGIN_TIMEOUT |
ct_config |
CS_MAX_CONNECT |
ct_config |
CS_NETIO |
ct_config |
CS_NOINTERRUPT |
ct_config |
CS_TEXTLIMIT |
ct_config |
CS_TIMEOUT |
ct_config |
CS_VERSION |
cs_config |
Connection handle. This is the handle for an individual client/server connection. The connection handle is defined in the program’s ct_con_alloc call. If parallel sessions are used, there must be one connection handle for each session. An application can have up to 25 connections.
Open ClientConnect uses a Connection Router program to define connections. Each connection handle corresponds to a connection defined with the Connection Router. For details about the Connection Router, see the Mainframe Connect Client Option Installation and Administration Guide.
A connection handle can have the following properties listed in Table 2-12.
Property |
Set by |
---|---|
CS_APPNAME |
ct_con_props |
CS_CHARSETCNV |
ct_con_props |
CS_COMMBLOCK |
ct_con_props |
CS_EXTRA_INF |
ct_con_props |
CS_HOSTNAME |
ct_con_props |
CS_LOC_PROP |
ct_con_props |
CS_LOGIN_STATUS |
ct_con_props |
CS_NET_DRIVER |
ct_con_props |
CS_NETIO |
ct_con_props |
CS_NOINTERRUPT |
ct_con_props |
CS_PACKETSIZE |
ct_con_props |
CS_PASSWORD |
ct_con_props |
CS_TDS_VERSION |
ct_con_props |
CS_TEXTLIMIT |
ct_con_props |
CS_TRANSACTION_NAME |
ct_con_props |
CS_USERNAME |
ct_con_props |
Command handle. A command handle defines a command space, which is used to send commands to a server over a connection and process the results. A command handle is defined in the program call ct_cmd_alloc. Each command handle is associated with a particular connection. A connection can have any number of command handles associated with it.
A command handle and its associated connection handle correspond to the TDPROC handle in the Open ServerConnect Gateway-Library. A command handle can have the following property:
CS_USERDATA (set by ct_cmd_props)
Table 2-13 lists the routines that allocate, use, and deallocate handles.
Structure |
Allocated and used by |
---|---|
CONTEXT |
cs_ctx_alloc, ct_config, cs_config, cs_ctx_drop |
CONNECTION |
ct_con_alloc, ct_con_props, ct_con_drop |
COMMAND |
ct_cmd_alloc, ct_cmd_props, ct_cmd_drop |