internal ServerCounters(EndPoint endpoint)
 {
     EndPoint = endpoint;
     Interactive = new ConnectionCounters(ConnectionType.Interactive);
     Subscription = new ConnectionCounters(ConnectionType.Subscription);
     Other = new ConnectionCounters(ConnectionType.None);
 }
Пример #2
0
 /// <summary>
 /// Creates a <see cref="ServerCounters"/> instance for an <see cref="EndPoint"/>.
 /// </summary>
 /// <param name="endpoint">The <see cref="EndPoint"/> to create counters for.</param>
 public ServerCounters(EndPoint endpoint)
 {
     EndPoint     = endpoint;
     Interactive  = new ConnectionCounters(ConnectionType.Interactive);
     Subscription = new ConnectionCounters(ConnectionType.Subscription);
     Other        = new ConnectionCounters(ConnectionType.None);
 }
Пример #3
0
 internal void GetCounters(ConnectionCounters counters)
 {
     lock (outstanding)
     {
         counters.SentItemsAwaitingResponse = outstanding.Count;
     }
     counters.Subscriptions = SubscriptionCount;
 }
 internal void GetCounters(ConnectionCounters counters)
 {
     counters.OperationCount            = OperationCount;
     counters.SocketCount               = Interlocked.Read(ref socketCount);
     counters.WriterCount               = Interlocked.CompareExchange(ref activeWriters, 0, 0);
     counters.NonPreferredEndpointCount = Interlocked.Read(ref nonPreferredEndpointCount);
     physical?.GetCounters(counters);
 }
Пример #5
0
 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);
 }
Пример #6
0
 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)
 {
     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 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;
 }
Пример #9
0
 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);
     var tmp = physical;
     if (tmp != null)
     {
         tmp.GetCounters(counters);
     }
 }
 internal void GetCounters(ConnectionCounters counters)
 {
     counters.CompletedSynchronously  = Interlocked.Read(ref completedSync);
     counters.CompletedAsynchronously = Interlocked.Read(ref completedAsync);
     counters.FailedAsynchronously    = Interlocked.Read(ref failedAsync);
 }
 internal void GetCounters(ConnectionCounters counters)
 {
     lock (outstanding)
     {
         counters.SentItemsAwaitingResponse = outstanding.Count;
     }
     counters.Subscriptions = SubscriptionCount;
 }