private Exception ReadException() { switch (ReplyStatus) { case ReplyStatus.UserException: { var istr = new InputStream(_communicator, Payload, 1); istr.StartEncapsulation(); RemoteException ex = istr.ReadException(); istr.EndEncapsulation(); return(ex); } case ReplyStatus.ObjectNotExistException: case ReplyStatus.FacetNotExistException: case ReplyStatus.OperationNotExistException: { return(ReadDispatchException()); } default: { Debug.Assert(ReplyStatus == ReplyStatus.UnknownException || ReplyStatus == ReplyStatus.UnknownLocalException || ReplyStatus == ReplyStatus.UnknownUserException); return(ReadUnhandledException()); } } }
/// <summary>Reads the empty parameter list, calling this methods ensure that the frame payload /// correspond to the empty parameter list.</summary> public void ReadEmptyParamList() { var istr = new InputStream(_communicator, Payload); istr.StartEncapsulation(); istr.EndEncapsulation(); }
/// <summary>Reads an empty return value from the response frame.</summary> public void ReadVoidReturnValue() { if (ReadResult().ResultType == ResultType.Failure) { // TODO: would be nicer to read then EndEncaps then throw the exception InputStream.ThrowException(); } InputStream.EndEncapsulation(); }
/// <summary>Reads the request frame parameter list.</summary> /// <param name="reader">An InputStreamReader delegate used to read the request frame /// parameters.</param> /// <returns>The request parameters, when the frame parameter list contains multiple parameters /// they must be return as a tuple.</returns> public T ReadParamList <T>(InputStreamReader <T> reader) { var istr = new InputStream(_communicator, Payload); istr.StartEncapsulation(); T paramList = reader(istr); istr.EndEncapsulation(); return(paramList); }
public IceInternal.EndpointI read(Ice.InputStream s) { short type = s.ReadShort(); Debug.Assert(type == _factory.type()); s.StartEncapsulation(); IceInternal.EndpointI endpoint = new EndpointI(_factory.read(s)); s.EndEncapsulation(); return(endpoint); }
/// <summary>Reads an empty return value from the response frame. If the response frame carries /// a failure, reads and throws this exception.</summary> public void ReadVoidReturnValue() { if (ReplyStatus == ReplyStatus.OK) { var istr = new InputStream(_communicator, Payload, 1); istr.StartEncapsulation(); istr.EndEncapsulation(); } else { throw ReadException(); } }
/// <summary>Reads the return value carried by this response frame using the provided InputStreamReader. /// If the response frame carries a failure, ReadReturnValue reads and throws this exception.</summary> /// <param name="reader">InputStreamReader that reads the return value.</param> /// <returns>The return value.</returns> public T ReadReturnValue <T>(InputStreamReader <T> reader) { if (ReadResult().ResultType == ResultType.Failure) { // TODO: would be nicer to read then EndEncaps then throw the exception InputStream.ThrowException(); } var returnValue = reader(InputStream); InputStream.EndEncapsulation(); return(returnValue); }
/// <summary>Reads the return value carried by this response frame. If the response frame carries /// a failure, reads and throws this exception.</summary> /// <param name="reader">An input stream reader used to read the frame return value, when the frame /// return value contain multiple values the reader must use a tuple to return the values.</param> /// <returns>The frame return value.</returns> public T ReadReturnValue <T>(InputStreamReader <T> reader) { if (ReplyStatus == ReplyStatus.OK) { var istr = new InputStream(_communicator, Payload, 1); istr.StartEncapsulation(); T ret = reader(istr); istr.EndEncapsulation(); return(ret); } else { throw ReadException(); } }
/// <summary>Reads an empty return value from the response frame.</summary> public void ReadVoidReturnValue() { InputStream istr = ReadReturnValue(); istr.EndEncapsulation(); }