private void ClientDisconnected(object sender, TcpServerClientDisconnectedEventArgs e) { Invoke(new Action(() => { ClientslistBox.Items.Clear(); foreach (Socket s in server._clientsList) { ClientslistBox.Items.Add(s.RemoteEndPoint.ToString()); } LogtextBox.Text = LogtextBox.Text + $"{ DateTime.Now.ToString() + "Clients:" + e.Socket.RemoteEndPoint.ToString()}已断开\r\n"; })); }
private void AsyncTcpServer1_ClientDisconnected(object sender, TcpServerClientDisconnectedEventArgs e) { Trace.WriteLine($"{e.Socket.RemoteEndPoint.ToString()}:已断开"); }