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); completionManager.GetCounters(counters); physical?.GetCounters(counters); }
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); } }