Send buffer and receive buffer sizes

The SO_RCVBUF option sets the size of the receive buffer and the SO_SNDBUF option sets the size of the send buffer. These options allow you to limit the amount of IP message table (IPMT) storage used by a given socket and are a primary flow control mechanism.

For TCP sockets, each packet that is sent includes a window size indicating how much more data the remote end is allowed to send. The z/TPF system sets the window size to the amount of available space in the receive buffer of the socket. When the z/TPF application can process the data faster than it is sent, end-to-end flow control is not really an issue. However, if the data arrives faster than the z/TPF application can process it, the rate at which the remote end sends data needs to be controlled.

For sockets where multiple messages can be sent to z/TPF without having to wait for a response to the first message, set the receive buffer size to a value large enough that the z/TPF application has data to process, which means that when the z/TPF application issues a read API call, there is data available. The goal is to read the data fast enough so the next piece of data is always ready when the z/TPF application requests (reads) the next message. z/TPF applications reading data too slowly can cause IPMT usage to increase because many messages will be queued while waiting for the z/TPF application to process them.

For UDP sockets, controlling the send and receive buffer sizes is the only flow control mechanism available unless you include application-level acknowledgments into your application design.