Click or drag to resize

UdpServerRead Method

Reads a number of bytes from the current received data buffer and writes those bytes into a byte array at the specified offset.

Namespace: GSF.Communication
Assembly: GSF.Communication (in GSF.Communication.dll) Version: 2.4.205-beta
Syntax
public override int Read(
	Guid clientID,
	byte[] buffer,
	int startIndex,
	int length
)
View Source

Parameters

clientID  Guid
ID of the client from which data buffer should be read.
buffer  Byte
Destination buffer used to hold copied bytes.
startIndex  Int32
0-based starting index into destination buffer to begin writing data.
length  Int32
The number of bytes to read from current received data buffer and write into buffer.

Return Value

Int32
The number of bytes read.

Implements

IServerRead(Guid, Byte, Int32, Int32)
Exceptions
ExceptionCondition
InvalidOperationException No received data buffer has been defined to read -or- Specified clientID does not exist, cannot read buffer.
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeExceptionstartIndex or length is less than 0 -or- startIndex and length will exceed buffer length.
Remarks
This function should only be called from within the ReceiveClientData event handler. Calling this method outside this event will have unexpected results.
See Also