Interface IProtocolProvider
- Namespace
- Sportradar.LiveData.Sdk.ProtocolProviders
- Assembly
- Sportradar.LiveData.Sdk.dll
public interface IProtocolProvider
Properties
AuthService
AuthService AuthService { get; set; }
Property Value
ConnectionProvider
The underlying connection provider.
IConnectionProvider ConnectionProvider { get; }
Property Value
IsStarted
Is the protocol provider running? True when yes, false otherwise.
bool IsStarted { get; }
Property Value
LogoutMessage
What should be tried to send before we disconnect?
[Obsolete]
string LogoutMessage { get; }
Property Value
ProtocolData
Settings relevant for the protocol.
IProtocolData ProtocolData { get; }
Property Value
SdkLogger
ISdkLogger SdkLogger { get; }
Property Value
Type
Protocol provider type.
ProtocolProviderType Type { get; }
Property Value
Methods
SendMessageRaw(string, TimeSpan)
Deliver a protocol unit in string format to the server.
void SendMessageRaw(string msg, TimeSpan ttl)
Parameters
msgstringProtocol unit message in string format
ttlTimeSpanTime how long the message is valid.
- if TimeSpan.Zero try delivery just once
- if TimeSpan.FromMilliseconds(-1), meaning Infinity try an infinite number of times
- else try ttl time long
Exceptions
- DisconnectedStateException
If timeout passes without success
- RateLimitingException
If sending the message would be over the limit
SendMessage<T>(T)
Deliver a protocol unit to the server (no matter whether it is connected or sure).
void SendMessage<T>(T msg) where T : IProtocolRequest
Parameters
msgTProtocol unit message
Type Parameters
TProtocol unit type derived from IProtocolRequest
Remarks
This method might block indefinitely.
SendMessage<T>(T, TimeSpan)
Deliver a protocol unit to the server.
void SendMessage<T>(T msg, TimeSpan ttl) where T : IProtocolRequest
Parameters
msgTProtocol unit message
ttlTimeSpanTime how long the message is valid.
- if TimeSpan.Zero try delivery just once
- if TimeSpan.FromMilliseconds(-1), meaning Infinity try an infinite number of times
- else try ttl time long
Type Parameters
TProtocol unit type derived from IProtocolRequest
Exceptions
- DisconnectedStateException
If timeout passes without success
- RateLimitingException
If sending the message would be over the limit
WaitForConnection()
Block until the connection is established.
bool WaitForConnection()
Returns
- bool
true if the connection is established; false if the wait time elapsed and no connection was established
Remarks
The method might return true and the connection can get broken right after that, so do not assume after that method we are for sure in a "connected" state, it might have been just a temporary state.
WaitForConnection(TimeSpan)
Block for a certain amount of time until the connection is established.
bool WaitForConnection(TimeSpan ttl)
Parameters
ttlTimeSpanTime to wait
Returns
- bool
true if the connection is established; false if the wait time elapsed and no connection was established
Remarks
The method might return true and the connection can get broken right after that, so do not assume after that method we are for sure in a "connected" state, it might have been just a temporary state.
WaitForDisconnection()
Block and wait until the connection is not established anymore.
bool WaitForDisconnection()
Returns
WaitForDisconnection(TimeSpan)
Block and wait until the connection is not established anymore.
bool WaitForDisconnection(TimeSpan wait_time)
Parameters
wait_timeTimeSpanTime to wait before timeout
Returns
Events
OnConnected
Invoked when the logical connection to the server is established.
event ConnectionProviderDelegates.ConnectionDelegate OnConnected
Event Type
OnDisconnected
Invoked when the logical connection to the server is broken.
event ConnectionProviderDelegates.ConnectionDelegate OnDisconnected
Event Type
OnInvalidMessageReceived
Invoked when a message was received by the lower layer that could not be validated or processed.
event ConnectionProviderDelegates.SimpleDataReceivedDelegate OnInvalidMessageReceived
Event Type
OnLoginFailed
event ConnectionProviderDelegates.LoginFailedDelegate OnLoginFailed
Event Type
OnParsedMessageReceived
Invoked when a new protocol data unit (implementing IProtocolResponse) is received.
event ProtocolProviderDelegates.ParsedDataReceivedDelegate OnParsedMessageReceived