/// <summary> /// 监听线程 /// </summary> private void RecvMessage() { while (ServerState == true) { TcpClient c = ServerMain.AcceptTcpClient(); FileSocket client = new FileSocket(c); client.onStateChange += Client_onStateChange1; ClientSockets.Add(client); Form1.Inove_ListBox_FulshClientList f = new Form1.Inove_ListBox_FulshClientList(window.ListBox_FulshClientList); window.BeginInvoke(f, client); } }
private void Client_onStateChange1(object serder, string oldState, string newState) { Form1.Inove_ListBox_FulshClientList f = new Form1.Inove_ListBox_FulshClientList(window.ListBox_FulshClientList); window.BeginInvoke(f, (FileSocket)serder); }