Example #1
0
        /// <summary>
        /// 添加客户端套接字
        /// </summary>
        /// <param name="socket"></param>
        public void Add(ClientSocket socket)
        {
            lock (syncRoot)
            {
                socket.OnMessage += OnMessage;
                socket.OnError   += OnError;
                socket.BeginReceive();
                dict[socket.Handle] = socket;
            }

            Console.WriteLine("client socket accepted, ip: {0}", socket.IP);
        }