Exemplo n.º 1
0
 private void ExecAction(HandlerAction action)
 {
     if (action.exception != null)
     {
         _settings.exception(this, action.exception);
     }
     else
     {
         Session session = OnAccept(action.socket);
         session.Start();
         _settings.accept(this, session);
     }
     action.server    = null;
     action.socket    = null;
     action.exception = null;
     action.Release();
 }
Exemplo n.º 2
0
 private void ExecAction(HandlerAction action)
 {
     if (action.exception != null)
     {
         _settings.exception(this, action.exception);
     }
     else if (action.request != null)
     {
         _settings.request(this, action.request);
         action.request.Execute(this);
         OnRequestRelease(action.request);
     }
     else if (action.length != 0)
     {
         _alivetime = Application.Now;
         if (action.length > 0)
         {
             _settings.read(this, action.length);
         }
         else
         {
             _settings.write(this, -action.length);
         }
     }
     else
     {
         if (_timer != null && _timer.IsRunning)
         {
             _timer.Stop();
         }
         _settings.close(this);
     }
     action.session   = null;
     action.exception = null;
     action.request   = null;
     action.length    = 0;
     action.Release();
 }
Exemplo n.º 3
0
Arquivo: Log.cs Projeto: libla/ULog
 void Update()
 {
     if (actions.Count == 0)
     {
         return;
     }
     lock (actions_mtx)
     {
         var tmp = actions_tmp;
         actions_tmp = actions;
         actions     = tmp;
     }
     for (int i = 0, j = actions_tmp.Count; i < j; ++i)
     {
         try
         {
             ExecWrite(actions_tmp[i]);
         }
         catch (Exception)
         {
         }
     }
     HandlerAction.Release(actions_tmp);
 }
Exemplo n.º 4
0
 private void ExecAction(HandlerAction action)
 {
     if (action.exception != null)
     {
         _settings.exception(this, action.exception);
     }
     else
     {
         Session session = OnAccept(action.socket);
         session.Start();
         _settings.accept(this, session);
     }
     action.server = null;
     action.socket = null;
     action.exception = null;
     action.Release();
 }