Set the TDS packet size in an application’s LOGINREC structure.
RETCODE DBSETLPACKET(login, packet_size) LOGINREC *login; short packet_size;
A pointer to the LOGINREC structure to be passed as an argument to dbopen when logging in to the server. An application can obtain a LOGINREC structure using dblogin.
The packet size being requested, in bytes. The server will set the actual packet size to a value less than or equal to this requested size.
SUCCEED or FAIL.
DBSETLPACKET sets the packet size field in an application’s LOGINREC structure. When the application logs into the server, the server sets the TDS packet size for that DBPROCESS connection to be equal to or less than the value of this field. The packet size is set to a value less than the value of the packet size field if the server is experiencing space constraints. Otherwise, the packet size will be equal to the value of the field.
If an application sends or receives large amounts of text or image data, a packet size larger than the default 512 bytes may improve efficiency, since it results in fewer network reads and writes.
To determine the packet size that the server has set, an application can call dbgetpacket.
TDS (Tabular Data Stream) is an application protocol used for the transfer of requests and request results between clients and servers.
TDS data is sent in fixed-size chunks, called packets. TDS packets have a default size of 512 bytes. The only way an application can change the TDS packet size is through DBSETLPACKET. If DBSETLPACKET is not called, all DBPROCESS connections in an application will use the default size.
Different DBPROCESS connections in an application may use different packet sizes. To set different packet sizes for DBPROCESS connections, an application can either:
Change the packet size in a single LOGINREC between the dbopen calls that create the DBPROCESS connections, or
Set different packet sizes in multiple LOGINREC structures, and use these different LOGINREC structures when creating the DBPROCESS connections.
Because the actual packet size for a DBPROCESS connection is set when the DBPROCESS is created, calls to DBSETLPACKET will have no effect on the packet sizes of DBPROCESSes already allocated using dbopen.