Interface ILiveFeeds
- Namespace
- Sportradar.LiveData.Sdk.FeedProviders.Common.Interfaces
- Assembly
- Sportradar.LiveData.Sdk.dll
Live feeds base client interface.
public interface ILiveFeeds : IStartable
- Inherited Members
Properties
AvailableTranslations
Language codes of the currently available translations.
string[] AvailableTranslations { get; }
Property Value
- string[]
LastAliveMessage
Get time when the last alive message from the server was received.
DateTime LastAliveMessage { get; }
Property Value
Remarks
Time is in UTC according to the local computer or DateTime.MinValue if no message was received yet in this session.
A too old value might indicate a problem. Notice that you should not check against this value and disconnect manually MaxTimeSkew setting is meant for that.
LastServerMessage
Get time when the last message from the server was received. This includes alive messages that are periodically sent.
DateTime LastServerMessage { get; }
Property Value
Remarks
Time is in UTC according to the local computer or DateTime.MinValue if no message was received yet in this session.
A too old value might indicate a problem. Notice that you should not check against this value and disconnect manually MaxTimeSkew setting is meant for that.
ServerTime
Get approximate server time.
DateTime? ServerTime { get; }
Property Value
Remarks
Time is is synchronized from LiveOdds server in every received message and periodically from LiveScout (according to ServerTimeSyncInterval). Interpolation is used so this should approximately be the time on the server (not the time of the last message). Value can be null if last successful synchronization was more than MaxServerTimestampAge ago.
SubscribedEvents
All event ids we are currently subscribed to.
long[] SubscribedEvents { get; }
Property Value
- long[]
Methods
BookEvents(IEnumerable<long>)
Book the specified events. Booked events cannot be cancelled through this interface.
long? BookEvents(IEnumerable<long> event_ids)
Parameters
event_idsIEnumerable<long>event ids
Returns
- long?
Request id. LiveOdds : You can use this to match response if "Include response reply number in meta" is enabled
Remarks
You should prefer using the Live Calendar on the Betradar website (http://www.betradar.com) which offers automatic booking for certain types of events.
Note that booking events will have a cost depending on the type of agreement you have with Sportradar.
LiveScout: Expect OnMatchBookingReply message in reply.
ClearState()
Clears complete state for this provider, that can otherwise be used in case of feed error recovery which can occur after every feed server reconnect or at initial SDK startup.
void ClearState()
Remarks
Should be used with extreme caution!
Subscribe(IEnumerable<long>)
Subscribe to specified events.
void Subscribe(IEnumerable<long> event_ids)
Parameters
event_idsIEnumerable<long>Array of event ids
Remarks
With LiveScout you must explicitly call Subscribe() at start-up or no data will be received.
Unsubscribe(IEnumerable<long>)
Sends a batch unsubscribe request to the server for the specified event IDs. After this request is processed, no more events associated with these event IDs will be sent.
void Unsubscribe(IEnumerable<long> event_ids)
Parameters
event_idsIEnumerable<long>Array of event ids
Remarks
LiveScout: Expect OnMatchStop message is response.
Events
OnFeedError
Signals that a feed error has occurred (e.g. we got disconnected from the feed server, XML message parsing error occurred).
event EventHandler<FeedErrorEventArgs> OnFeedError
Event Type
Remarks
It is suggested that this event handler is wired to some Monitoring Service