Transfer TDS login response information from a CS_CONNECTION structure to a newly allocated CS_LOGINFO structure.
CS_RETCODE ct_getloginfo (connection, logptr) CS_CONNECTION *connection; CS_LOGINFO **logptr;
A pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection.
A pointer to a program variable which ct_getloginfo sets to the address of a newly allocated CS_LOGINFO structure.
ct_getloginfo returns the following values:
Return value |
Meaning |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
CS_BUSY |
An asynchronous operation is already pending for this connection. See “Asynchronous programming”. |
TDS (Tabular Data Stream) is a communications protocol used for the transfer of requests and request results between clients and servers.
There are two reasons an application might call ct_getloginfo:
If it is an Open Server gateway application using TDS passthrough.
To copy login properties from an open connection to a newly allocated connection structure.
Do not call ct_getloginfo from within a completion callback routine. ct_getloginfo calls system-level memory functions that may not be reentrant.
When a client connects directly to a server, the two programs negotiate the TDS format they will use to send and receive data. When a gateway application uses TDS passthrough, the gateway forwards TDS packets between the client and a remote server without examining or processing them. For this reason, the remote server and the client must agree on a TDS format to use.
ct_getloginfo is the third of four calls, two of them Server Library calls, that allow a client and a remote server to negotiate a TDS format. The calls, which can be made only in an Open Server SRV_CONNECT event handler, are:
srv_getloginfo to allocate a CS_LOGINFO structure and fill it with TDS information from a client login request.
ct_setloginfo to transfer the TDS information retrieved in step 1 from the CS_LOGINFO structure to a Client-Library CS_CONNECTION structure. The gateway uses this CS_CONNECTION structure in the ct_connect call which establishes its connection with the remote server.
ct_getloginfo to transfer the remote server’s response to the client’s TDS information from the CS_CONNECTION structure into a newly allocated CS_LOGINFO structure.
srv_setloginfo to send the remote server’s response, retrieved in step c, to the client.
For information about using ct_getloginfo to copy login properties from an open connection to a newly allocated connection structure, see “Properties”.