StreamLink.NET  7.1.6-7.1.6-3952-ee12172
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
Caplin.StreamLink.BaseConnectionListener Class Reference

Adapter class implementing the IConnectionListener methods More...

Inheritance diagram for Caplin.StreamLink.BaseConnectionListener:
Caplin.StreamLink.IConnectionListener

Public Member Functions

virtual void OnConnectionStatusChange (IConnectionStatusEvent connectionStatusEvent)
 Override if you want to receive the status change of the connection. More...
 
virtual void OnServiceStatusChange (IServiceStatusEvent serviceStatusEvent)
 Override if you want to receive the status change of the data service. More...
 
virtual void OnSourceStatusChange (ISourceStatusEvent sourceStatusEvent)
 Override if you want to receive the status change of the Integration Adapter. More...
 
virtual void OnStatisticsChange (IStatisticsEvent statisticsEvent)
 Override if you want to receive the status change in the connection statistics. More...
 

Detailed Description

Adapter class implementing the IConnectionListener methods

This is a helper class to reduce the code needed to implement the ConnectionListener interface.

Simply extend this class and override the required methods rather than implement the full IConnectionListener interface.

A trivial implementation would be as follows :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caplin.StreamLink;
namespace Caplin.StreamLink.ExampleSnippets.Listener
{
class BaseConnectionListenerSnippet
{
public BaseConnectionListenerSnippet()
{
// Define and add connection listener.
IConnectionListener listener = new ExampleConnectionListener();
}
class ExampleConnectionListener : BaseConnectionListener
{
// Print connection status message to console.
public void OnConnectionStatusChange(IConnectionStatusEvent evt)
{
Console.WriteLine(evt.ToString());
}
// Print latency to console.
public void OnStatisticsChange(IStatisticsEvent evt)
{
Console.WriteLine("Latency is: " + evt.AverageLatency);
}
};
}
}

Member Function Documentation

virtual void Caplin.StreamLink.BaseConnectionListener.OnConnectionStatusChange ( IConnectionStatusEvent  connectionStatusEvent)
inlinevirtual

Override if you want to receive the status change of the connection.

Parameters
connectionStatusEventThe new status of the connection.
virtual void Caplin.StreamLink.BaseConnectionListener.OnServiceStatusChange ( IServiceStatusEvent  serviceStatusEvent)
inlinevirtual

Override if you want to receive the status change of the data service.

Parameters
serviceStatusEventThe new status of the data service.
virtual void Caplin.StreamLink.BaseConnectionListener.OnSourceStatusChange ( ISourceStatusEvent  sourceStatusEvent)
inlinevirtual

Override if you want to receive the status change of the Integration Adapter.

Parameters
sourceStatusEventThe new status of the Integration Adapter.
virtual void Caplin.StreamLink.BaseConnectionListener.OnStatisticsChange ( IStatisticsEvent  statisticsEvent)
inlinevirtual

Override if you want to receive the status change in the connection statistics.

Parameters
statisticsEventThe new connection statistics.

Generated on Tue Apr 28 2020 06:25:29 for StreamLink.NET