Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages

kStatus kTcpClient_SetWriteBuffers | ( | kTcpClient | client,
|  | kSSize | socketSize,
|  | kSSize | clientSize
| ) |  |

Sets the size of write buffers.

Socket buffers decouple the sender and receiver, so that the sender does not need to block while waiting for the receiver to receive all bytes. Client buffers improve the efficiency of the client when performing several small write operations.

By default, the client buffer size is zero and the socket buffer size is determined by the underlying operating system.

On some systems, server-side socket buffer sizes must be determined before kTcpClient objects are created in kTcpServer_Accept. Accordingly, server-side implementations should use kTcpServer_SetWriteBuffers to set buffer sizes instead of kTcpClient_SetWriteBuffers.

Parameters

  client | TCP client object.
  socketSize | Size of the write buffer maintained by the underlying socket (-1 to leave unchanged).
  clientSize | Size of the write buffer maintained by the client object (-1 to leave unchanged).

Returns
  Operation status.

See also
  kTcpServer_SetWriteBuffers