protected override void OnStart(IConnection connection, string connectionData, CancellationToken disconnectToken)
{
_disconnectRegistration = disconnectToken.SafeRegister(state =>
{
// _reconnectInvoker can be null if disconnectToken is tripped before the polling loop is started
if (_reconnectInvoker != null)
{
_reconnectInvoker.Invoke();
}
StopPolling();
}, null);
StartPolling(connection, connectionData);
}