/** * When an error comes in, this handles it */ public void HandleError(ReqrepManager man, int message_number, ReqrepManager.ReqrepError err, ISender ret_path, object state) { Exception x = null; RpcRequestState rs = (RpcRequestState)state; Channel bq = rs.Results; switch (err) { case ReqrepManager.ReqrepError.NoHandler: x = new AdrException(-32601, "No RPC Handler on remote host"); break; case ReqrepManager.ReqrepError.HandlerFailure: x = new AdrException(-32603, "The remote RPC System had a problem"); break; case ReqrepManager.ReqrepError.Timeout: //In this case we close the Channel: if (bq != null) { bq.Close(); } break; case ReqrepManager.ReqrepError.Send: //We had some problem sending, but ignore it for now break; } if (x != null && (bq != null)) { RpcResult res = new RpcResult(ret_path, x); bq.Enqueue(res); } }
/// <summary>If the request really failed, we'll have to close the SA.</summary> public void HandleError(ReqrepManager man, int message_number, ReqrepManager.ReqrepError err, ISender returnpath, object state) { if (man.RequestActive(message_number)) { return; } PeerSecAssociation sa = state as PeerSecAssociation; sa.Failure(); }
public void HandleError(ReqrepManager man, int message_number, ReqrepManager.ReqrepError err, ISender ret_path, object state) { _rrman.StopRequest(message_number, this); RpcManager my_rpc = System.Threading.Interlocked.Exchange(ref _rpc, null); if (my_rpc != null) { //We have not sent any reply yet: my_rpc.SendResult(_req_state, new Exception(String.Format("Error: {0} from: {1}", err, ret_path))); } }
/// <summary>If the request really failed, we'll have to close the SA.</summary> public void HandleError(ReqrepManager man, int message_number, ReqrepManager.ReqrepError err, ISender returnpath, object state) { if (man.RequestActive(message_number)) { return; } PeerSecAssociation sa = state as PeerSecAssociation; ProtocolLog.WriteIf(ProtocolLog.Security, "Forcing reset due to timeout: " + sa); sa.Reset(); }
public void HandleError(ReqrepManager man, int message_number, ReqrepManager.ReqrepError err, ISender from, object state) { Console.WriteLine("Got Error from: {0}, {1}, {2}", from, message_number, err); }