|
PortController.NET
ReceiveBufferSize Property
Sets and returns the recommended size of the port's internal input buffer, in bytes.
Syntax
[Visual Basic]
object.ReceiveBufferSize [ = value ]
[C#]
object.ReceiveBufferSize [ = value ]
[C++]
object->ReceiveBufferSize [ = value ]
Parameters
object
An object expression that evaluates to a PortController object.
value
An integer indicating the recommended size of the port's internal input buffer, in bytes.
Return Value
An integer representing the recommended size of the port's internal input buffer, in bytes.
Remarks
- The port receives the recommended buffer sizes, but is free to use any input and output (I/O) buffering scheme, as long as it provides reasonable performance and data is not lost due to overrun (except under extreme circumstances).
- This property affects only the UART receive buffer. PortController.NET maintains its own internal buffer which is able to dynamically grow with the amount of incoming data.
Errors
If PortController is unable to set the receive buffer size, a "Failed trying to set buffer size. This could be because the specified buffer size was too large." exception is thrown.
Example
[Visual Basic]
' Set receive buffer size
myPortController.ReceiveBufferSize = 4096
' Get receive buffer size
Dim BufferSize As Int16
BufferSize = myPortController.ReceiveBufferSize
[C#]
// Set receive buffer size
myPortController.ReceiveBufferSize = 4096;
// Get receive buffer size
Int16 BufferSize = myPortController.ReceiveBufferSize;
[C++]
// Set receive buffer size
myPortController->ReceiveBufferSize = 4096;
// Get receive buffer size
Int16 BufferSize = myPortController->ReceiveBufferSize;
See Also
TransmitBufferSize property
|