StandardSocketOptions.SoRcvbuf Property

Definition

The size of the socket receive buffer.

[Android.Runtime.Register("SO_RCVBUF", ApiSince=24)]
public static Java.Net.ISocketOption? SoRcvbuf { get; }
[<Android.Runtime.Register("SO_RCVBUF", ApiSince=24)>]
static member SoRcvbuf : Java.Net.ISocketOption

Property Value

Attributes

Remarks

The size of the socket receive buffer.

The value of this socket option is an Integer that is the size of the socket receive buffer in bytes. The socket receive buffer is an input buffer used by the networking implementation. It may need to be increased for high-volume connections or decreased to limit the possible backlog of incoming data. The value of the socket option is a <em>hint</em> to the implementation to size the buffer and the actual size may differ.

For datagram-oriented sockets, the size of the receive buffer may limit the size of the datagrams that can be received. Whether datagrams larger than the buffer size can be received is system dependent. Increasing the socket receive buffer may be important for cases where datagrams arrive in bursts faster than they can be processed.

In the case of stream-oriented sockets and the TCP/IP protocol, the size of the socket receive buffer may be used when advertising the size of the TCP receive window to the remote peer.

The initial/default size of the socket receive buffer and the range of allowable values is system dependent although a negative size is not allowed. An attempt to set the socket receive buffer to larger than its maximum size causes it to be set to its maximum size.

An implementation allows this socket option to be set before the socket is bound or connected. Whether an implementation allows the socket receive buffer to be changed after the socket is bound is system dependent.

Java documentation for java.net.StandardSocketOptions.SO_RCVBUF.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to