private void _onRequestFail(GeneralFailure e) { Log.Warn("Jopa ({0})", e); _swlr = SwlResult.GENERAL_FAIL; if (_commEvent != null) { _commEvent.Set(); } }
private void _onTimerTick(object state) { // TODO: test the below code for thread-freedom and performance var expired = new List<Connection>(); expired.AddRange(_inConnections.ToList().Where(c => c.IsExpired)); expired.AddRange(_outConnections.ToList().Where(c => c.IsExpired)); expired.Apply(c => c.Close("IdleExpired")); foreach (var c in _outConnections.ToList()) { var tentries = c.Inbox.RemoveAll(e => e.IsTimedout); foreach (var e in tentries) { try { var timeout = new GeneralFailure(GeneralFailureCode.OperationTimeout); ServicesManager.InvokeFailureHandler(e.Request, timeout, e.FailureHandler); } catch (Exception ex) { _logException(ex, e.Request, null, c.IsClosing || ex is IOException); if (ex.IsA<BplServiceHandlerException>()) { if (e.Request.IsA<IBplRequestMessage>()) { try { // quickly respond with general error, to avoid client waiting too long until timeout ServicesManager.SendServiceFailure(e.Request, new GeneralFailure(), this); } catch { } } } else { // only close connection in case of unexpected exceptions c.Close("RequestTimeout"); break; } } } } }
private void _onFailure(GeneralFailure e) { Log.Warn("Driver info is not found ({0})", e); if (_isReplyRequired) { Rethrow(e); } }
private void _onFailure(GeneralFailure e) { Log.Warn("Vehicle info is not found ({0})", e); }