Return protocol format information from a remote server to a client.
CS_RETCODE srv_setloginfo(spp, loginfop)
SRV_PROC *spp; CS_LOGINFO *loginfop;
A pointer to an internal thread control structure.
A pointer to a CS_LOGINFO structure that has been updated by ct_getloginfo.
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local Prototype.
*/
CS_RETCODE ex_srv_setloginfo PROTOTYPE((
SRV_PROC *spp,
CS_LOGINFO *loginfop
));
/*
** EX_SRV_SETLOGINFO
**
** Return protocol format information from a remote server to
** a client.
**
**
** Arguments:
**
** spp A pointer to an internal thread control structure.
** loginfop A pointer to a CS_LOGINFO structure that has been
** updated by ct_getloginfo.
**
** Returns
**
** CS_SUCCEED
** CS_FAIL
**
*/
CS_RETCODE ex_srv_setloginfo(spp, loginfop)
SRV_PROC *spp;
CS_LOGINFO *loginfop;
{
/* Check arguments. */
if(spp == (SRV_PROC *)NULL)
{
return(CS_FAIL);
}
return(srv_setloginfo(spp,loginfop));
}
Use srv_setloginfo in gateway server applications that pass protocol (TDS) packets between clients and remote Sybase servers without interpreting the contents of the packet.
When a client connects directly to a server, the two programs negotiate the protocol format they will use to send and receive data. When you use protocol passthrough in a gateway application, the Open Server forwards protocol packets between the client and a remote server.
srv_setloginfo is the fourth of four calls, two of them are CT-Library calls, that allow a client and remote server to negotiate a TDS format. The calls, which can only be made in a SRV_CONNECT event handler, are:
srv_getloginfo – Allocate a CS_LOGINFO structure and fill it with TDS information from the client thread.
ct_setloginfo – Prepare a CS_LOGINFO structure with the protocol information retrieved in step 1, then log in to the remote server with ct_connect.
ct_getloginfo – Transfer protocol login response information from a CS_CONNECTION structure to the newly allocated CS_LOGINFO structure.
srv_setloginfo – Send the remote server’s response, retrieved in step 3, to the client, then release the CS_LOGINFO structure.