aboutsummaryrefslogtreecommitdiff
path: root/Tools/Hazel-Networking/Hazel/ListenerStatistics.cs
blob: 428c5676f5f335430335a167f72931f178e5a67f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Threading;

namespace Hazel
{
    public class ListenerStatistics
    {
        private int _receiveThreadBlocked;
        public int ReceiveThreadBlocked => this._receiveThreadBlocked;

        private long _bytesSent;
        public long BytesSent => this._bytesSent;

        internal void AddReceiveThreadBlocking()
        {
            Interlocked.Increment(ref _receiveThreadBlocked);
        }

        internal void AddBytesSent(long bytes)
        {
            Interlocked.Add(ref _bytesSent, bytes);
        }
    }
}