public void Walk(Action <KestrelConnection> callback)
        {
            foreach (var kvp in _connectionReferences)
            {
                var reference = kvp.Value;

                if (reference.TryGetConnection(out var connection))
                {
                    callback(connection);
                }
                else if (_connectionReferences.TryRemove(kvp.Key, out reference))
                {
                    // It's safe to modify the ConcurrentDictionary in the foreach.
                    // The connection reference has become unrooted because the application never completed.
                    _trace.ApplicationNeverCompleted(reference.ConnectionId);
                }

                // If both conditions are false, the connection was removed during the heartbeat.
            }
        }
Beispiel #2
0
 public void ApplicationNeverCompleted(string connectionId)
 {
     _trace1.ApplicationNeverCompleted(connectionId);
     _trace2.ApplicationNeverCompleted(connectionId);
 }