示例#1
0
 protected virtual void RaiseNewClientEvent(MyTCPClient myClt)
 {
     // Raise the event by using the () operator.
     if (NewClientEvent != null)
     {
         NewClientEvent(this, new NewClientEventArgs(myClt));
     }
 }
示例#2
0
        private async void mainTrdRun()
        {
            while (started)
            {
                TcpClient client = await lsnr.AcceptTcpClientAsync();

                var myClt = new MyTCPClient(client);

                new Thread(() => RaiseNewClientEvent(myClt)).Start();
            }
        }