Class FragmentedMessageHandler
Inheritance
System.Object
FragmentedMessageHandler
Namespace: Eco.Shared.Networking
Assembly: Eco.Shared.dll
Syntax
public class FragmentedMessageHandler : Object
Constructors
FragmentedMessageHandler()
Declaration
public FragmentedMessageHandler()
FragmentedMessageHandler(TimeSpan)
Declaration
public FragmentedMessageHandler(TimeSpan ttl)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | ttl |
Properties
TTL
Gets or sets fragmented message Time-To-Life, if during this interval message will not be assembled then it will be cleaned up.
Declaration
public TimeSpan TTL { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Methods
TryGetCompleteBuffer(in UdpDataMessage, out UdpDataMessage)
Handles incoming message which may be a fragment. Will return same message if message is complete and may be processed further. If it is a message fragment then it will be added to collection of message fragments. As soon as all message fragments will be collected it will assemble NetBuffer with message content.
Declaration
public bool TryGetCompleteBuffer(in UdpDataMessage message, out UdpDataMessage completeMessage)
Parameters
Type | Name | Description |
---|---|---|
UdpDataMessage | message | UdpIncomingMessage message which may be fragment or complete message. |
UdpDataMessage | completeMessage | UdpIncomingMessage containing complete message data if success, null otherwise. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if able to get complete buffer, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | In case of a fragment inconsistency. |