TCP socket buffer size configuration

Use CS_TCP_RCVBUF and CS_TCP_SNDBUF context/connection properties to set the size of TCP socket input and output buffers on the client side. Open Client applications use these property settings to set buffer sizes with the operating system setsockopt command. Because setsockopt must be invoked before the TCP connect and accept commands, set these properties before attempting to create a connection.

Set these properties as appropriate for your application. For example, if the client is expected to be sending a large amount of data to the server, set CS_TCP_SNDBUF to a large value to increase the corresponding buffer sizes.

NoteUse the SRV_S_TCP_RCVBUF and SRV_S_TCP_SNDBUF server properties to set TCP socket input and output buffer sizes on the server side. See the Open Server Server-Library/C Reference Manual.

Context example

ct_config(*context, CS_SET, CS_TCP_RCVBUF, &bufsize, CS_UNUSED, NULL);

Connection example

ct_con_props(*connection, CS_SET, CS_TCP_RCVBUF, &bufsize, CS_UNUSED, NULL);