ReceiveBufferSize Property

Socket.ReceiveBufferSize Property

 

Gets or sets a value that specifies the size of the receive buffer of the Socket.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

member ReceiveBufferSize : int with get, set

Property Value

Type: System.Int32

An Int32 that contains the size, in bytes, of the receive buffer. The default is 8192.

Exception Condition
SocketException

An error occurred when attempting to access the socket.

ObjectDisposedException

The Socket has been closed.

ArgumentOutOfRangeException

The value specified for a set operation is less than 0.

A larger buffer size potentially reduces the number of empty acknowledgements (TCP packets with no data portion), but might also delay the recognition of connection difficulties. Consider increasing the buffer size if you are transferring large files, or you are using a high bandwidth, high latency connection (such as a satellite broadband provider.)

The following code example demonstrates the use of the ReceiveBufferSize property.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show:
© 2016 Microsoft