コード例 #1
0
        private void onAccepted(TcpClient tcpClient)
        {
            SocketProcessor processor = new SocketProcessor(tcpClient, logHelper);

            processor.Disconnected += new EventHandler(processor_Disconnected);
            processor.Start();
            lock (this._socketProcessors)
            {
                this._socketProcessors.Add(processor);
            }
            onConnected();
        }
コード例 #2
0
        void processor_Disconnected(object sender, EventArgs e)
        {
            SocketProcessor p = sender as SocketProcessor;

            p.Disconnected -= processor_Disconnected;
            lock (this._socketProcessors)
            {
                if (this._socketProcessors.Contains(p))
                {
                    this._socketProcessors.Remove(p);
                }
            }
            onDisconnected();
        }
コード例 #3
0
 private void onAccepted(TcpClient tcpClient)
 {
     SocketProcessor processor = new SocketProcessor(tcpClient, logHelper);
     processor.Disconnected += new EventHandler(processor_Disconnected);
     processor.Start();
     lock (this._socketProcessors)
     {
         this._socketProcessors.Add(processor);
     }
     onConnected();
 }