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
IUdpDialectThe UDP dialect.
name
stringThe client name.
address
MulticastSourceAddressThe 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
IsEnabled
Gets a value indicating whether the client is enabled.
public bool IsEnabled { get; }
Property Value
Name
Gets the client name.
public override string Name { get; }
Property Value
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
stringThe specified reason.
ErrorHandler(Exception, int, bool)
Handles errors that occur during packet processing.
public void ErrorHandler(Exception e, int numErrors, bool isFatal)
Parameters
e
ExceptionThe exception encountered.
numErrors
intThe error count.
isFatal
boolIndicates whether the error is fatal.
ProcessNewPacket(IMemoryOwner<byte>)
public bool ProcessNewPacket(IMemoryOwner<byte> packet)
Parameters
packet
IMemoryOwner<byte>