Socket.ReceiveBufferSize Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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)

Public Property ReceiveBufferSize As Integer

Property Value

Type: System.Int32

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

Exception Condition

An error occurred when attempting to access the socket.


The Socket has been closed.


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
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top