public static void Run() { ThreadPoolServer.rc = rc; Socket acceptingSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); acceptingSocket.Bind(new IPEndPoint(IPAddress.Any, 8081)); acceptingSocket.Listen(50); while (true) { Socket s = acceptingSocket.Accept(); ThreadPool.QueueUserWorkItem(new WaitCallback(SocketHelper.ProcessConnection), s); } }
/// <summary>Start the ratecounter</summary> public static void StartRateCounter(TimeSpan ts) { SocketHelper.rc = new RateCounter(ts); }