예제 #1
0
        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);
            }
        }
예제 #2
0
 /// <summary>Start the ratecounter</summary>
 public static void StartRateCounter(TimeSpan ts)
 {
     SocketHelper.rc = new RateCounter(ts);
 }