SO_RCVBUF

The SO_RCVBUF socket option determines the size of a socket's receive buffer that is used by the underlying transport. This socket option applies only to listening sockets, datagram sockets, and connection-oriented sockets.

To set the value of this socket option, a WSK application calls the WskControlSocket function with the following parameters.

Parameter Value

RequestType

WskSetOption

ControlCode

SO_RCVBUF

Level

SOL_SOCKET

InputSize

sizeof(ULONG)

InputBuffer

A pointer to a ULONG-typed variable that contains the new size of the socket's receive buffer

OutputSize

0

OutputBuffer

NULL

OutputSizeReturned

NULL

To retrieve the value of the SO_RCVBUF socket option, a WSK application calls the WskControlSocket function with the following parameters.

Parameter Value

RequestType

WskGetOption

ControlCode

SO_RCVBUF

Level

SOL_SOCKET

InputSize

0

InputBuffer

NULL

OutputSize

sizeof(ULONG)

OutputBuffer

A pointer to a ULONG-typed variable that receives the current size of the socket's receive buffer

OutputSizeReturned

NULL

A WSK application must specify a pointer to an IRP when calling the WskControlSocket function to set or retrieve the value of the SO_RCVBUF socket option.

The default size of a socket's receive buffer is transport-specific. Some transports might not support this socket option.

If this socket option is set on a listening socket, all incoming connections that are accepted on that listening socket have their receive buffer set to the same size that is specified for the listening socket. A WSK application can call the WskControlSocket function on an accepted socket to override the size of the receive buffer that was inherited from the listening socket.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Ws2def.h (include Wsk.h)