internal void HandleCall(Caller clientInfo) { var rpcMessage = new RpcMessage(this.xdrReader); this.xid = rpcMessage.Xid; if (rpcMessage.Body.MessageType != MessageType.Call) { throw new RpcException( $"Message type should be {nameof(MessageType.Call)} but was {rpcMessage.Body.MessageType}."); } if (rpcMessage.Body.CallBody.RpcVersion != 2) { RpcMessage reply = this.GenerateRpcVersionMismatch(2, 2); reply.WriteTo(this.xdrWriter); return; } if (rpcMessage.Body.CallBody.Program != this.program) { RpcMessage reply = this.GenerateReply(AcceptStatus.ProgramUnavailable); reply.WriteTo(this.xdrWriter); return; } this.Version = rpcMessage.Body.CallBody.Version; this.Procedure = rpcMessage.Body.CallBody.Procedure; this.Caller = clientInfo; this.receivedCallDispatcher(this); }
public void Reply(IXdrWritable result) { RpcMessage reply = this.GenerateReply(AcceptStatus.Success); reply.WriteTo(this.xdrWriter); result.WriteTo(this.xdrWriter); }
public void ProgramMismatch() { RpcMessage reply = this.GenerateProgramMismatch(this.lowVersion, this.highVersion); reply.WriteTo(this.xdrWriter); }
public void ProcedureUnavailable() { RpcMessage reply = this.GenerateReply(AcceptStatus.ProcedureUnavailable); reply.WriteTo(this.xdrWriter); }