Example #1
0
 internal ServerCounters(EndPoint endpoint)
 {
     EndPoint     = endpoint;
     Interactive  = new ConnectionCounters(ConnectionType.Interactive);
     Subscription = new ConnectionCounters(ConnectionType.Subscription);
     Other        = new ConnectionCounters(ConnectionType.None);
 }
 internal void GetCounters(ConnectionCounters counters)
 {
     lock (outstanding)
     {
         counters.SentItemsAwaitingResponse = outstanding.Count;
     }
     counters.Subscriptions = SubscriptionCount;
 }
 internal void GetCounters(ConnectionCounters counters)
 {
     lock (asyncCompletionQueue)
     {
         counters.ResponsesAwaitingAsyncCompletion = asyncCompletionQueue.Count;
     }
     counters.CompletedSynchronously  = Interlocked.Read(ref completedSync);
     counters.CompletedAsynchronously = Interlocked.Read(ref completedAsync);
     counters.FailedAsynchronously    = Interlocked.Read(ref failedAsync);
 }
 internal void GetCounters(ConnectionCounters counters)
 {
     counters.PendingUnsentItems        = queue.Count();
     counters.OperationCount            = OperationCount;
     counters.SocketCount               = Interlocked.Read(ref socketCount);
     counters.WriterCount               = Interlocked.CompareExchange(ref activeWriters, 0, 0);
     counters.NonPreferredEndpointCount = Interlocked.Read(ref nonPreferredEndpointCount);
     completionManager.GetCounters(counters);
     physical?.GetCounters(counters);
 }
 internal void Add(ConnectionCounters other)
 {
     if (other == null)
     {
         return;
     }
     CompletedAsynchronously          += other.CompletedAsynchronously;
     CompletedSynchronously           += other.CompletedSynchronously;
     FailedAsynchronously             += other.FailedAsynchronously;
     OperationCount                   += other.OperationCount;
     PendingUnsentItems               += other.PendingUnsentItems;
     ResponsesAwaitingAsyncCompletion += other.ResponsesAwaitingAsyncCompletion;
     SentItemsAwaitingResponse        += other.SentItemsAwaitingResponse;
     SocketCount               += other.SocketCount;
     Subscriptions             += other.Subscriptions;
     WriterCount               += other.WriterCount;
     NonPreferredEndpointCount += other.NonPreferredEndpointCount;
 }