• Version 1.7.1
Show / Hide Table of Contents

Class Gateway

CME iLink 3 Gateway Emulator.

Inheritance
object
Gateway
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OnixS.Cme.ILink3.Testing
Assembly: OnixS.Cme.ILink3.dll
Syntax
public class Gateway : IDisposable

Constructors

Gateway(int, SessionSettings, LogFactory)

Creates a new instance on a loopback interface.

Listen port.Settings.
Declaration
public Gateway(int listenPort, SessionSettings settings, LogFactory logFactory = null)
Parameters
Type Name Description
int listenPort
SessionSettings settings
LogFactory logFactory

Gateway(int, Tuple<IDecoder, IEncoder>, LogFactory)

Declaration
protected Gateway(int listenPort, Tuple<IDecoder, IEncoder> decoding, LogFactory logFactory)
Parameters
Type Name Description
int listenPort
Tuple<IDecoder, IEncoder> decoding
LogFactory logFactory

Gateway(IPAddress, int, SessionSettings, LogFactory)

Creates a new instance.

Interface address.Listen port.Settings.
Declaration
public Gateway(IPAddress address, int listenPort, SessionSettings settings, LogFactory logFactory = null)
Parameters
Type Name Description
IPAddress address
int listenPort
SessionSettings settings
LogFactory logFactory

Gateway(IPAddress, int, Tuple<IDecoder, IEncoder>, LogFactory)

Declaration
protected Gateway(IPAddress address, int listenPort, Tuple<IDecoder, IEncoder> decoding, LogFactory logFactory)
Parameters
Type Name Description
IPAddress address
int listenPort
Tuple<IDecoder, IEncoder> decoding
LogFactory logFactory

Fields

Logger

Declaration
protected readonly Logger Logger
Field Value
Type Description
Logger

socket

Declaration
protected TcpSocket socket
Field Value
Type Description
TcpSocket

Properties

FaultToleranceIndicator

Declaration
public FaultToleranceIndicator FaultToleranceIndicator { get; set; }
Property Value
Type Description
FaultToleranceIndicator

ListenPort

Listen port.

Declaration
public int ListenPort { get; }
Property Value
Type Description
int

SendReceiveSpinTimeout

Send and receive spin timeout before switching to the blocking wait mode.

Note: The spin wait increases the CPU usage so the spin wait period should not be too long.

Declaration
public TimeSpan SendReceiveSpinTimeout { get; set; }
Property Value
Type Description
TimeSpan

SendReceiveTimeout

Send and receive blocking wait timeout.

Declaration
public TimeSpan SendReceiveTimeout { get; set; }
Property Value
Type Description
TimeSpan

Uuid

Gets the negotiated Uuid.

Declaration
public ulong Uuid { get; protected set; }
Property Value
Type Description
ulong

Methods

AcceptConnection(TimeSpan)

Accepts an incoming connection.

Declaration
public void AcceptConnection(TimeSpan timeout)
Parameters
Type Name Description
TimeSpan timeout

AcceptEstablish(int, int, ulong, int)

Accept Session Establish.

Declaration
public IMessage AcceptEstablish(int outgoingSequenceNumber = 1, int expectedIncomingSequenceNumber = 1, ulong previousUuid = 0, int previousSeqNo = 0)
Parameters
Type Name Description
int outgoingSequenceNumber
int expectedIncomingSequenceNumber
ulong previousUuid
int previousSeqNo
Returns
Type Description
IMessage

AcceptNegotiate(uint)

Accept Session Negotiate

Declaration
public IMessage AcceptNegotiate(uint previousSeqNo = 0)
Parameters
Type Name Description
uint previousSeqNo
Returns
Type Description
IMessage

AcceptSession(int, int, ulong, int)

Accepts an incoming session.

Declaration
public void AcceptSession(int outgoingSequenceNumber = 1, int expectedIncomingSequenceNumber = 1, ulong previousUuid = 0, int previousSeqNo = 0)
Parameters
Type Name Description
int outgoingSequenceNumber
int expectedIncomingSequenceNumber
ulong previousUuid
int previousSeqNo

CreateEstablishmentAck(IMessage)

Declaration
protected IMessage CreateEstablishmentAck(IMessage establish)
Parameters
Type Name Description
IMessage establish
Returns
Type Description
IMessage

CreateNegotiationResponse(IMessage)

Declaration
protected IMessage CreateNegotiationResponse(IMessage request)
Parameters
Type Name Description
IMessage request
Returns
Type Description
IMessage

CreateSequence(int, KeepAliveLapsed)

Declaration
protected IMessage CreateSequence(int nextSeqNo = -1, KeepAliveLapsed keepAliveLapsed = KeepAliveLapsed.NotLapsed)
Parameters
Type Name Description
int nextSeqNo
KeepAliveLapsed keepAliveLapsed
Returns
Type Description
IMessage

CreateTerminateReply(IMessage)

Declaration
protected IMessage CreateTerminateReply(IMessage request)
Parameters
Type Name Description
IMessage request
Returns
Type Description
IMessage

Decoder()

Gets decoder instance to encode messages.

Declaration
public IDecoder Decoder()
Returns
Type Description
IDecoder

An decoder object.

Disconnect()

Breaks the connection.

Declaration
public void Disconnect()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

Encoder()

Gets encoder instance to encode messages.

Declaration
public IEncoder Encoder()
Returns
Type Description
IEncoder

An encoder object.

~Gateway()

Declaration
protected ~Gateway()

Receive()

Receives a SBE message.

Declaration
public IMessage Receive()
Returns
Type Description
IMessage

SBE message

Send(IMessage)

Sends the given message.

Declaration
public void Send(IMessage message)
Parameters
Type Name Description
IMessage message

Send(IMessage, int)

Sends the given message with the given sequence number.

Declaration
public void Send(IMessage message, int sequenceNumber)
Parameters
Type Name Description
IMessage message
int sequenceNumber

SendSequence(int, KeepAliveLapsed)

Sends a Sequence message.

Declaration
public void SendSequence(int nextSeqNum, KeepAliveLapsed keepAliveLapsed = KeepAliveLapsed.NotLapsed)
Parameters
Type Name Description
int nextSeqNum
KeepAliveLapsed keepAliveLapsed

ShutdownConnection()

Shuts the connection down.

Declaration
public void ShutdownConnection()

Stop()

Stops listening.

Declaration
public void Stop()

TryAcceptConnection(TimeSpan)

Accepts an incoming connection.

Declaration
public bool TryAcceptConnection(TimeSpan timeout)
Parameters
Type Name Description
TimeSpan timeout
Returns
Type Description
bool

WaitUntilTerminate(TimeSpan, Action<IMessage>)

Processes messages until a Terminate message is received.

Declaration
public void WaitUntilTerminate(TimeSpan timeout, Action<IMessage> onMessage)
Parameters
Type Name Description
TimeSpan timeout
Action<IMessage> onMessage

WaitUntilTerminate(TimeSpan, Action<IMessage>, Action<IMessage>, ref bool)

Processes messages until a Terminate message is received.

Declaration
public IMessage WaitUntilTerminate(TimeSpan timeout, Action<IMessage> onMessage, Action<IMessage> onSequence, ref bool stopRequested)
Parameters
Type Name Description
TimeSpan timeout
Action<IMessage> onMessage
Action<IMessage> onSequence
bool stopRequested
Returns
Type Description
IMessage

WaitUntilTerminate(TimeSpan, Action<IMessage>, ref bool)

Processes messages until a Terminate message is received.

Declaration
public void WaitUntilTerminate(TimeSpan timeout, Action<IMessage> onMessage, ref bool stopRequested)
Parameters
Type Name Description
TimeSpan timeout
Action<IMessage> onMessage
bool stopRequested

Implements

IDisposable
In this article
Back to top Copyright © Onix Solutions.
Generated by DocFX