Click or drag to resize

Sdk Class

Main entry point for the SDK client application.
Inheritance Hierarchy
SystemObject
  Sportradar.SDK.Services.SdkSdk

Namespace: Sportradar.SDK.Services.Sdk
Assembly: Sdk (in Sdk.dll) Version: 2.28.0.0
Syntax
C#
public sealed class Sdk : IStartable, IDisposable

The Sdk type exposes the following members.

Properties
 NameDescription
Public propertyBetPal BetPal provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyStatic memberInstance SDK singleton instance.
Public propertyIsInitialized True if the SDK initialized, false otherwise. See the Initialize.
Public propertyIsStarted True if the SDK started, false otherwise. See the Initialize.
Public propertyLcoo Live Cycle of Odds provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOdds LivePlex provider. BetPal and LiveOdds combined in single feed.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOddsVbl LiveOdds Virtual Basketball League provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOddsVdr LiveOdds Virtual Football League provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOddsVfc LiveOdds Virtual Football cup provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOddsVfl LiveOdds Virtual Football League provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOddsVhc LiveOdds Virtual Football League provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveOddsVto LiveOdds Virtual Tennis Open provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLivePlex LivePlex provider. BetPal and LiveOdds combined in single feed.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyLiveScout LiveScout provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyOddsCreator OddsCreator provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Public propertyQueueStats Queue statistics.
Public propertySoccerRoulette SoccerRoulette provider.
Remarks
Initialize must be called before accessing this member. If provider is not enabled through configuration, this member will be null.
Top
Methods
 NameDescription
Public methodDispose Releases unmanaged resources held by an instance of this class.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInitialize Initialize the SDK. Default section name is used from the app.config. DEFAULT_SECTION_NAME
Public methodCode exampleInitialize(IConfigFactory, IDeadLetterQueue) Initialize the SDK.
Public methodInitialize(String, IDeadLetterQueue) Initialize the SDK.
Public methodStart Starts the SDK instance but does not start the configured feed providers (e.g. LiveScout or LiveOdds). SDK message dispatcher pump will start delivering messages after this.
Remarks
Feed providers should be started explicitly after SDK singleton is started.
Public methodStop Stops the SDK. Stops the message pump and all feeds.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventOnQueueLimits Indicates that a queue limit (NORMAL, LOW, HIGH) was either reached or retreated for a specific queue.
Top
Example
C#
try
{
    Sdk.Instance.Initialize();

    Sdk.Instance.OnQueueLimits += QueueLimits;
    Sdk.Instance.OnQueueLimitRetreated += QueueLimitRetreated;

    Sdk.Instance.Start();

    if (Sdk.Instance.LiveOdds != null)
    {
        Sdk.Instance.LiveOdds.OnConnectionStable += FlagConnectionAsStable;
        Sdk.Instance.LiveOdds.OnConnectionUnstable += ConnectionUnstable;

        Sdk.Instance.LiveOdds.OnAlive += AliveReceived;
        Sdk.Instance.LiveOdds.OnFeedError += FeedErrorOccurred;
        Sdk.Instance.LiveOdds.OnBetCancel += MatchBetCancelled;
        Sdk.Instance.LiveOdds.OnBetCancelUndo += MatchBetCancelUndo;
        Sdk.Instance.LiveOdds.OnBetClear += MatchBetCleared;
        Sdk.Instance.LiveOdds.OnBetClearRollback += MatchBetClearRollbacked;
        Sdk.Instance.LiveOdds.OnBetStart += BetStarted;
        Sdk.Instance.LiveOdds.OnBetStop += BetStopped;
        Sdk.Instance.LiveOdds.OnMetaInfo += MetaInfoReceived;
        Sdk.Instance.LiveOdds.OnOddsChange += OddsChanged;
        Sdk.Instance.LiveOdds.OnScoreCardSummary += ScoreCardReceived;

        Sdk.Instance.LiveOdds.Start();
    }
    else
    {
        throw new ApplicationException("Error initializing SDK.LiveOdds provider");
    }

    /* ... start using the SDK ... */
    Console.ReadLine();
}
finally
{
    if (Sdk.Instance.LiveOdds != null)
    {
        Sdk.Instance.LiveOdds.Stop();

        Sdk.Instance.LiveOdds.OnConnectionStable -= FlagConnectionAsStable;
        Sdk.Instance.LiveOdds.OnConnectionUnstable -= ConnectionUnstable;

        Sdk.Instance.LiveOdds.OnAlive -= AliveReceived;
        Sdk.Instance.LiveOdds.OnFeedError -= FeedErrorOccurred;
        Sdk.Instance.LiveOdds.OnBetCancel -= MatchBetCancelled;
        Sdk.Instance.LiveOdds.OnBetCancelUndo -= MatchBetCancelUndo;
        Sdk.Instance.LiveOdds.OnBetClear -= MatchBetCleared;
        Sdk.Instance.LiveOdds.OnBetClearRollback -= MatchBetClearRollbacked;
        Sdk.Instance.LiveOdds.OnBetStart -= BetStarted;
        Sdk.Instance.LiveOdds.OnBetStop -= BetStopped;
        Sdk.Instance.LiveOdds.OnMetaInfo -= MetaInfoReceived;
        Sdk.Instance.LiveOdds.OnOddsChange -= OddsChanged;
        Sdk.Instance.LiveOdds.OnScoreCardSummary -= ScoreCardReceived;
    }

    Sdk.Instance.OnQueueLimits -= QueueLimits;
    Sdk.Instance.OnQueueLimitRetreated -= QueueLimitRetreated;

    Sdk.Instance.Stop();
}
See Also