Пример #1
0
 private void AcceptClientCallback(IAsyncResult res)
 {
     try
     {
         var c = new OTcpClient(Listener.EndAcceptTcpClient(res),this);
         c.Closed += this.OnClosed;
         Interlocked.Increment(ref ClientCount);
         this.log.InfoFormat("Client connected on {0}",c.EndPoint);
         this.log.InfoFormat("Client Count {0}", ClientCount);
         Listener.BeginAcceptTcpClient(this.AcceptClientCallback, Listener);
     }
     catch (Exception e)
     {
         this.log.Error("Client connection error",e);
     }
 }
Пример #2
0
 private void AcceptClientCallback(IAsyncResult res)
 {
     try
     {
         var c = new OTcpClient(Listener.EndAcceptTcpClient(res), this);
         c.Closed += this.OnClosed;
         Interlocked.Increment(ref ClientCount);
         this.log.InfoFormat("Client connected on {0}", c.EndPoint);
         this.log.InfoFormat("Client Count {0}", ClientCount);
         Listener.BeginAcceptTcpClient(this.AcceptClientCallback, Listener);
     }
     catch (Exception e)
     {
         this.log.Error("Client connection error", e);
     }
 }
Пример #3
0
 private void OnClosed(EventArgs eventArgs, OTcpClient oTcpClient)
 {
     Interlocked.Decrement(ref ClientCount);
     this.log.InfoFormat("Client Count {0}", ClientCount);
 }
Пример #4
0
 private void OnClosed(EventArgs eventArgs, OTcpClient oTcpClient)
 {
     Interlocked.Decrement(ref ClientCount);
     this.log.InfoFormat("Client Count {0}", ClientCount);
 }