private bool ReceiveReply(IXdrReadable result, out string errorMessage) { var reply = new RpcMessage(); reply.ReadFrom(this.xdrReader); if (reply.Xid != this.rpcMessage.Xid) { errorMessage = $"Wrong XID. Expected {this.rpcMessage.Xid}, but was {reply.Xid}."; return(false); } if (reply.Body.MessageType != MessageType.Reply) { errorMessage = $"Wrong message type. Expected {MessageType.Reply}, but was {reply.Body.MessageType}."; return(false); } if (reply.Body.ReplyBody.ReplyStatus != ReplyStatus.Accepted) { errorMessage = "Call was denied."; return(false); } if (reply.Body.ReplyBody.AcceptedReply.ReplyData.AcceptStatus != AcceptStatus.Success) { errorMessage = $"Call was unsuccessful: {reply.Body.ReplyBody.AcceptedReply.ReplyData.AcceptStatus}."; return(false); } result.ReadFrom(this.xdrReader); this.networkReader.EndReading(); errorMessage = null; return(true); }
public void RetrieveCall(IXdrReadable argument) => argument.ReadFrom(this.xdrReader);