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.IKeymasterPollResponseListener Interface Reference

Defines the interface that should be implemented by the application to receive KeyMaster keep alive Responses. More...

Public Member Functions

void OnKeymasterError (string reason)
 Returns an unsuccessful KeyMaster keep alive Response. More...
 
void OnKeymasterResponse (string response)
 Returns a successful KeyMaster keep alive Response. Implementing this method is optional. More...
 

Detailed Description

Defines the interface that should be implemented by the application to receive KeyMaster keep alive Responses.

The KeymasterPollResponseListener needs to be added to the StreamLinkFactory create method in order to receive callbacks.

Typically an application would notify the user when onKeymasterError is called and ask them to sign in again.

A trivial implementation would be as follows :

using Caplin.StreamLink;
using System;
namespace Caplin.StreamLink.ExampleSnippets.Listener
{
public class KeymasterResponseListenerSnippet
{
public KeymasterResponseListenerSnippet()
{
string config = "{" +
"liberator_urls: 'http://liberator.caplin.com'," +
"username: 'user1@caplin.com'," +
"password: 'admin'" +
"}";
StreamLinkFactory.Create(config, new ExampleKeymasterPollResponseListener());
}
}
class ExampleKeymasterPollResponseListener : IKeymasterPollResponseListener
{
public void OnKeymasterResponse(string response)
{
Console.WriteLine(response);
}
public void OnKeymasterError(string reason)
{
Console.WriteLine(reason);
}
}
}

Member Function Documentation

void Caplin.StreamLink.IKeymasterPollResponseListener.OnKeymasterError ( string  reason)

Returns an unsuccessful KeyMaster keep alive Response.

  • Parameters
    reasonThe error text.
void Caplin.StreamLink.IKeymasterPollResponseListener.OnKeymasterResponse ( string  response)

Returns a successful KeyMaster keep alive Response. Implementing this method is optional.

  • Parameters
    responseThe response text.

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