Click or drag to resize

PacketChangedEventArgsExtensionsTryGetData Method

Gets the packet received from the network that caused this event to be raised. Returns null if the packet has already been read from the socket.

Namespace:  Demo3D.Net
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 15.0.2.11458
Syntax
C#
public static (bool valid, BufferSegment data) TryGetData(
	this PacketChangedEventArgs args
)

Parameters

args
Type: Demo3D.NetPacketChangedEventArgs
The packet event args.

Return Value

Type: ValueTupleBoolean, BufferSegment
The data from the packet that raised the event, or null if that packet has already been read from the socket.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type PacketChangedEventArgs. 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
For byte stream protocols (eg TCP) this will return the data that has been received, which may not include all the data that the peer has sent.
See Also