public TransportDisconnectBase(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartBeat heartBeat)
 {
     _context = context;
     _jsonSerializer = jsonSerializer;
     _heartBeat = heartBeat;
     _timeoutTokenSource = new CancellationTokenSource();
     _hostShutdownToken = context.HostShutdownToken();
 }
Exemplo n.º 2
0
        public TransportDisconnectBase(HostContext context, ITransportHeartBeat heartBeat)
        {
            _context = context;
            _heartBeat = heartBeat;
            _timeoutTokenSource = new CancellationTokenSource();

            // Register the callback to cancel this connection
            var hostShutdownToken = context.HostShutdownToken();
            if (hostShutdownToken != CancellationToken.None)
            {
                hostShutdownToken.Register(_timeoutTokenSource.Cancel);
            }
        }