About PortController
Introduction
Purchasing PortController
Redistributing PortController
License Agreement
Support
Getting Started
How to Use PortController
PortController Sample Projects
Handling PortController Errors
Reference
Properties
AvailableSystemPorts
BaudRate Property
Break Property
BytesUsedRQ Property
BytesUsedTQ Property
Cd Property
Cts Property
DataBits Property
Dsr Property
Dtr Property
DtrDsr Property
EnableReadOnEventChar Property
EventChar Property
ForceBeginInvokeEventFiring Property
IsOpen Property
IsFileTransferInProgress Property
Parity Property
PortHandle Property
PortName Property
ReceiveBufferSize Property
Ring Property
Rts Property
RtsCts Property
StopBits Property
SystemPorts Property
TraceOutput Property
TransmitBufferSize
XoffByte Property
XonByte Property
XonXoff Property
Methods
CancelFileTransfer Method
ClearRQ Method
ClearTQ Method
Close Method
GetErrorStatus Method
Open Method
Read Method
ReadBinary Method
ReceiveFileXModem Method
ReceiveFileXModemCRC Method
ReceiveFileYModem Method
ReceiveFileZModem Method
SendFileXModem Method
SendFileXModem1k Method
SendFileYModem Method
SendFileZModem Method
SimulateReceivedXoff Method
SimulateReceivedXon Method
Write Method
WriteBinary Method
Events
OnBreakSignal Event
OnCdToggle Event
OnCtsToggle Event
OnDataReceived Event
OnDsrToggle Event
OnError Event
OnEventCharReceived Event
OnFileTransferComplete Event
OnFileTransferStatusUpdate Event
OnRing Event
OnTQEmpty Event

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