Dart.PowerTCP.EmailValidation Namespace > Tcp Class : ReceiveBufferSize Property |
Gets and sets the size of the system receive buffer.
[Visual Basic]
<CategoryAttribute("Socket Options")>
<DescriptionAttribute("Gets and Sets the size of the system receive buffer.")>
<DefaultValueAttribute()>
Public Property ReceiveBufferSize As Integer
[C#]
[CategoryAttribute("Socket Options")]
[DescriptionAttribute("Gets and Sets the size of the system receive buffer.")]
[DefaultValueAttribute()]
public int ReceiveBufferSize {get; set;}
[C++]
[CategoryAttribute("Socket Options")]
[DescriptionAttribute("Gets and Sets the size of the system receive buffer.")]
[DefaultValueAttribute()]
public: __property int get_ReceiveBufferSize();
public: __property void set_ReceiveBufferSize(
int value
);
[C++/CLI]
[CategoryAttribute("Socket Options")]
[DescriptionAttribute("Gets and Sets the size of the system receive buffer.")]
[DefaultValueAttribute()]
public:
property int ReceiveBufferSize {
int get();
void set (int value);
}
Size of the system receive buffer in bytes. The default is 8192.
This property sets the size of the system receive buffer. The default is 8192 which means that if the total data's bytes you are receiving exceeds this you will need to call Tcp.Receive multiple times until Tcp.Connected = false.
The following example demonstrates sending and receiving data using byte arrays.
[Visual Basic]
' Connect to an echo port
Tcp1.Connect("atropos", 7)
' Send some bytes
Dim buffer As Byte() = System.Text.Encoding.Default.GetBytes("test")
Tcp1.Stream.Write(buffer, 0, buffer.Length)
' Receive the echoed data
Dim response(Tcp1.ReceiveBufferSize) As Byte
Tcp1.Stream.Read(response, 0, Tcp1.ReceiveBufferSize)
' Close the connection
Tcp1.Close()
' Display the response
Debug.WriteLine(System.Text.Encoding.Default.GetString(response))
[C#]
// Connect to an echo port
tcp1.Connect("atropos",
7);
// Send some bytes
byte[] buffer =
System.Text.Encoding.Default.GetBytes("test");
tcp1.Stream.Write(buffer, 0, buffer.Length);
// Receive the echoed data
byte[] response
= new byte[tcp1.ReceiveBufferSize];
tcp1.Stream.Read(response, 0, tcp1.ReceiveBufferSize);
// Close the connection
tcp1.Close();
// Display the response
Debug.WriteLine(System.Text.Encoding.Default.GetString(response));
Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista
Send comments on this topic.
Documentation version 1.0.3.0.
© 2008 Dart Communications. All rights reserved.