Пример #1
0
 private void ClientConnected(object sender, TcpServerClientConnectedEventArgs 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";
     }));
 }
Пример #2
0
 private void AsyncTcpServer1_ClientConnected(object sender, TcpServerClientConnectedEventArgs e)
 {
     Trace.WriteLine($"{e.Socket.RemoteEndPoint.ToString()}:已连接");
 }