Show / Hide Table of Contents

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.

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾