예제 #1
0
 private void OnAccept(IAsyncResult ar)
 {
     try
     {
         Socket conn = _socket.EndAccept(ar);
         log.Info("Connection from: " + conn.RemoteEndPoint);
         _reader.AcceptSocket(conn, this);
         _socket.BeginAccept(OnAccept, null);
     }catch (Exception failed)
     {
         if (_running)
         {
             log.Warn("Accept Failed", failed);
         }
     }
 }