예제 #1
0
        private Exception ReadException()
        {
            switch (ReplyStatus)
            {
            case ReplyStatus.UserException:
            {
                return(InputStream.ReadEncapsulation(_communicator, Protocol.GetEncoding(), Payload.Slice(1),
                                                     istr => istr.ReadException()));
            }

            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());
            }
            }
        }
예제 #2
0
 /// <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)
     {
         return(InputStream.ReadEncapsulation(_communicator, Protocol.GetEncoding(), Payload.Slice(1), reader));
     }
     else
     {
         throw ReadException();
     }
 }
예제 #3
0
 /// <summary>Reads the request frame parameter list.</summary>
 /// <param name="communicator">The communicator.</param>
 /// <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>(Communicator communicator, InputStreamReader <T> reader) =>
 InputStream.ReadEncapsulation(communicator, Protocol.GetEncoding(), Payload, reader);
예제 #4
0
 /// <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) =>
 InputStream.ReadEncapsulation(_communicator, Ice1Definitions.Encoding, Payload, reader);