static void Server_ClientConnected(object sender, NetFrame.TCP.Server.Sock.Synchronous.SocketEventArgs e) { Console.WriteLine("客户端连接成功" + e._handle.client.RemoteEndPoint.ToString()); socket = e._handle; timer = new System.Timers.Timer(); timer.Elapsed += timer_Elapsed; timer.Interval = 80; timer.Enabled = true; }
static void Server_ClientDisconnected(object sender, NetFrame.TCP.Server.Sock.Synchronous.SocketEventArgs e) { socket = null; }