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(); }
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(); }
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); }
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(); }