Table of Contents

Class NetworkClient<TNetworkClient>

Namespace
StockSharp.Fix.Native
Assembly
StockSharp.Udp.Core.dll

Abstract base class for UDP network clients.

[CLSCompliant(false)]
public abstract class NetworkClient<TNetworkClient> : BaseLogReceiver, IPersistable, INetworkClient, ILogReceiver, ILogSource, IDisposable where TNetworkClient : NetworkClient<TNetworkClient>

Type Parameters

TNetworkClient

The concrete network client type.

Inheritance
NetworkClient<TNetworkClient>
Implements
Inherited Members
Extension Methods

Constructors

NetworkClient(IUdpDialect, string, MulticastSourceAddress, Func<TNetworkClient, IMemoryOwner<byte>, bool>)

Initializes a new instance of the NetworkClient<TNetworkClient> class.

protected NetworkClient(IUdpDialect dialect, string name, MulticastSourceAddress address, Func<TNetworkClient, IMemoryOwner<byte>, bool> processMessage)

Parameters

dialect IUdpDialect

The UDP dialect.

name string

The client name.

address MulticastSourceAddress

The multicast source address.

processMessage Func<TNetworkClient, IMemoryOwner<byte>, bool>

Function to process received messages.

Properties

Dialect

Gets the UDP dialect associated with this client.

public IUdpDialect Dialect { get; }

Property Value

IUdpDialect

IsEnabled

Gets a value indicating whether the client is enabled.

public bool IsEnabled { get; }

Property Value

bool

Name

Gets the client name.

public override string Name { get; }

Property Value

string

Methods

Connect()

Connects the client using the specified serializer.

public void Connect()

Disconnect()

Disconnects the client.

public void Disconnect()

DisposeManaged()

Disposes the managed resources. Override this method to add custom clean up of managed resources.

protected override void DisposeManaged()

DisposePacket(IMemoryOwner<byte>, string)

Disposes the packet with the specified reason.

public void DisposePacket(IMemoryOwner<byte> packet, string reason)

Parameters

packet IMemoryOwner<byte>

The packet.

reason string

The specified reason.

ErrorHandler(Exception, int, bool)

Handles errors that occur during packet processing.

public void ErrorHandler(Exception e, int numErrors, bool isFatal)

Parameters

e Exception

The exception encountered.

numErrors int

The error count.

isFatal bool

Indicates whether the error is fatal.

ProcessNewPacket(IMemoryOwner<byte>)

public bool ProcessNewPacket(IMemoryOwner<byte> packet)

Parameters

packet IMemoryOwner<byte>

Returns

bool