StreamLink.NET  7.1.10-7.1.10-4099-f4b14b3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
Caplin.StreamLink.IConnectionListener Interface Reference

Defines the interface for receiving information about changes in the state of the StreamLink connection, the data services available from the Liberator, and the DataSources that are normally connected to the Liberator. More...

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

Public Member Functions

void OnConnectionStatusChange (Caplin.StreamLink.IConnectionStatusEvent connectionStatusEvent)
 Invoked when the state of the StreamLink connection changes. Implementing this method is optional. More...
 
void OnServiceStatusChange (Caplin.StreamLink.IServiceStatusEvent serviceStatusEvent)
 Invoked when the state of a data service available from the Liberator changes. Implementing this method is optional. More...
 
void OnSourceStatusChange (Caplin.StreamLink.ISourceStatusEvent sourceStatusEvent)
 Invoked when the state of one of the Integration Adapters connected to Liberator changes. More...
 
void OnStatisticsChange (Caplin.StreamLink.IStatisticsEvent statisticsEvent)
 Invoked when new connection statistics are available. Implementing this method is optional. More...
 

Detailed Description

Defines the interface for receiving information about changes in the state of the StreamLink connection, the data services available from the Liberator, and the DataSources that are normally connected to the Liberator.

You should implement this interface if your application needs to take particular actions when such state changes occur.

Your application should not call into StreamLink when the connection status changes; StreamLink manages the connection state and will recover the connection to the Liberator without your application intervening.

A trivial implementation would be as follows :

using System;
using Caplin.StreamLink;
namespace Caplin.StreamLink.ExampleSnippets.Listener
{
public class ConnectionListenerSnippet
{
public ConnectionListenerSnippet(IStreamLink streamLink)
{
streamLink.AddConnectionListener(new ExampleConnectionListener());
}
class ExampleConnectionListener : IConnectionListener
{
public void OnStatisticsChange(IStatisticsEvent statisticsEvent)
{
Console.WriteLine("Latency : " + statisticsEvent.AverageLatency);
}
public void OnSourceStatusChange(ISourceStatusEvent sourceStatusEvent)
{
Console.WriteLine(sourceStatusEvent.SourceName + " is now " + sourceStatusEvent.SourceStatus);
}
public void OnServiceStatusChange(IServiceStatusEvent serviceStatusEvent)
{
Console.WriteLine(serviceStatusEvent.ServiceName + " is now " + serviceStatusEvent.ServiceStatus);
}
public void OnConnectionStatusChange(IConnectionStatusEvent connectionStatusEvent)
{
Console.WriteLine("Connection State : " + connectionStatusEvent.ConnectionState);
}
}
}
}

Member Function Documentation

void Caplin.StreamLink.IConnectionListener.OnConnectionStatusChange ( Caplin.StreamLink.IConnectionStatusEvent  connectionStatusEvent)

Invoked when the state of the StreamLink connection changes. Implementing this method is optional.

  • Parameters
    connectionStatusEventThe new status of the connection.
void Caplin.StreamLink.IConnectionListener.OnServiceStatusChange ( Caplin.StreamLink.IServiceStatusEvent  serviceStatusEvent)

Invoked when the state of a data service available from the Liberator changes. Implementing this method is optional.

  • Parameters
    serviceStatusEventThe new status of the data service.
void Caplin.StreamLink.IConnectionListener.OnSourceStatusChange ( Caplin.StreamLink.ISourceStatusEvent  sourceStatusEvent)

Invoked when the state of one of the Integration Adapters connected to Liberator changes.

** Implementing this method is optional.

  • Parameters
    sourceStatusEventThe new status of the Integration Adapter.
void Caplin.StreamLink.IConnectionListener.OnStatisticsChange ( Caplin.StreamLink.IStatisticsEvent  statisticsEvent)

Invoked when new connection statistics are available. Implementing this method is optional.

  • Parameters
    statisticsEventThe new connection statistics.

Generated on Tue Dec 22 2020 06:26:59 for StreamLink.NET