Exemplo n.º 1
0
        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());
            }
            }
        }
Exemplo n.º 2
0
        /// <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();
        }
Exemplo n.º 3
0
 /// <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();
 }
Exemplo n.º 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)
        {
            var istr = new InputStream(_communicator, Payload);

            istr.StartEncapsulation();
            T paramList = reader(istr);

            istr.EndEncapsulation();
            return(paramList);
        }
Exemplo n.º 5
0
    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);
    }
Exemplo n.º 6
0
 /// <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();
     }
 }
Exemplo n.º 7
0
        /// <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);
        }
Exemplo n.º 8
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)
     {
         var istr = new InputStream(_communicator, Payload, 1);
         istr.StartEncapsulation();
         T ret = reader(istr);
         istr.EndEncapsulation();
         return(ret);
     }
     else
     {
         throw ReadException();
     }
 }
Exemplo n.º 9
0
        /// <summary>Reads an empty return value from the response frame.</summary>
        public void ReadVoidReturnValue()
        {
            InputStream istr = ReadReturnValue();

            istr.EndEncapsulation();
        }