/// <summary> /// 初始化Connection,专用于服务一个成功连接的TcpClient /// <para>Sets up the class to handle the communication to the given TcpClient.</para> /// </summary> /// <param name="client">The TcpClient to communicate with.</param> public async override void HandleClient(object obj) { TcpClient client = obj as TcpClient; ControlClient = client; RemoteEndPoint = (IPEndPoint)ControlClient.Client.RemoteEndPoint; ClientIP = RemoteEndPoint.Address.ToString(); ControlStream = ControlClient.GetStream(); OnConnected(); }