Exemplo n.º 1
0
        public void Dispose()
        {
            lock (_contextLock)
            {
                if (_completed)
                {
                    return;
                }

                _log.ConnectionDisconnect(_connectionId);
                _completed = true;
                _pipeWriter.Complete();
            }
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            lock (_contextLock)
            {
                if (_completed)
                {
                    return;
                }

                _log.ConnectionDisconnect(_connectionId);
                _completed = true;
                _pipeWriter.Complete();

                var unsentBytes = _totalBytesCommitted - _transportBytesWrittenFeature.TotalBytesWritten;

                if (unsentBytes > 0)
                {
                    // unsentBytes should never be over 64KB in the default configuration.
                    _timeoutControl.StartTimingWrite((int)Math.Min(unsentBytes, int.MaxValue));
                    _pipeWriter.OnReaderCompleted((ex, state) => ((ITimeoutControl)state).StopTimingWrite(), _timeoutControl);
                }
            }
        }
Exemplo n.º 3
0
 public void ConnectionDisconnect(string connectionId)
 {
     _trace1.ConnectionDisconnect(connectionId);
     _trace2.ConnectionDisconnect(connectionId);
 }