Properties

The context/connection properties for setting TCP input and output buffer sizes are CS_TCP_RCVBUF and CS_TCP_SNDBUF.

Client-Library properties for buffer size configuration

Property

Meaning

*buffer value

Level

CS_TCP_RCVBUF

Size of the input buffer for the client application

A positive integer

Context, connection

CS_TCP_SNDBUF

Size of the output buffer for the client application

A positive integer

Context, connection

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);

The server properties for setting TCP input and output buffer sizes are SRV_S_TCP_RCVBUF and SRV_S_TCP_SNDBUF.

Server properties for buffer size configuration

Property

SET/ CLEAR

GET

bufp when cmd is CS_SET

bufp when cmd is CS_GET

SRV_S_TCP_RCVBUF

Yes

Yes

A CS_INT

A CS_INT

SRV_S_TCP_SNDBUF

Yes

Yes

A CS_INT

A CS_INT

Server example

srv_props(cp, CS_SET, SRV_S_TCP_SNDBUF, bufp, CS_SIZEOF(CS_INT), (CS_INT *)NULL);
  • Set these parameters 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 and SRV_S_TCP_RCVBUF to large values to increase the corresponding buffer sizes.

  • By default, the socket buffer size is set to the maximum allowable size for the operating system.