Click or drag to resize

PacketIOServiceReadAsync Method

Gets a data buffer for reading.

Namespace:  Demo3D.Net
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 10.0.0.0 (10.0.0.0)
Syntax
C#
public static Task<PacketReader> ReadAsync(
	this IPacketIOService service,
	Endian endian = null,
	BinaryTextEncoding textEncoding = null
)

Parameters

service
Type: Demo3D.NetIPacketIOService
The IPacketIOService.
endian (Optional)
Type: Demo3D.IOEndian
The endian format of the data being read (or null if not known).
textEncoding (Optional)
Type: Demo3D.IOBinaryTextEncoding
The text encoding format of any strings in the data being read (or null if not known).

Return Value

Type: TaskPacketReader
A PacketReader that contains the data read.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IPacketIOService. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
It's a mistake to call Read or ReadAsync in parallel in multiple threads. Although these methods are thread safe, the order in which each is processed is undetermined. (There is no guaranteed order, such as FIFO or LIFO for these methods to detect/return a packet.)
See Also