Exemplo n.º 1
0
        internal DispatchException ReadDispatchException()
        {
            var    istr      = new InputStream(_communicator, Payload, 1);
            var    identity  = new Identity(istr);
            string facet     = istr.ReadFacet();
            string operation = istr.ReadString();

            if (ReplyStatus == ReplyStatus.OperationNotExistException)
            {
                return(new OperationNotExistException(identity, facet, operation));
            }
            else
            {
                return(new ObjectNotExistException(identity, facet, operation));
            }
        }
Exemplo n.º 2
0
        /// <summary>Creates a new OutgoingRequestFrame.</summary>
        /// <param name="communicator">The communicator to use when initializing the stream.</param>
        /// <param name="data">The frame data as an array segment.</param>
        public IncomingRequestFrame(Communicator communicator, ArraySegment <byte> data)
        {
            _communicator = communicator;
            Data          = data;
            var istr = new InputStream(communicator, data);

            Identity     = new Identity(istr);
            Facet        = istr.ReadFacet();
            Operation    = istr.ReadString();
            IsIdempotent = istr.ReadOperationMode() != OperationMode.Normal;
            Context      = istr.ReadContext();
            Payload      = Data.Slice(istr.Pos);
            (Encoding encoding, int size) = istr.ReadEncapsulationHeader();
            if (size != Payload.Count)
            {
                throw new InvalidDataException($"invalid encapsulation size: {size}");
            }
            Encoding = encoding;
        }
Exemplo n.º 3
0
        private static void PrintIdentityFacetOperation(System.IO.StringWriter s, Ice.InputStream str)
        {
            try
            {
                Ice.ToStringMode toStringMode = str.Communicator.ToStringMode;

                var identity = new Ice.Identity(str);
                s.Write("\nidentity = " + identity.ToString(toStringMode));

                string facet = str.ReadFacet();
                s.Write("\nfacet = ");
                if (facet.Length > 0)
                {
                    s.Write(IceUtilInternal.StringUtil.EscapeString(facet, "", toStringMode));
                }

                string operation = str.ReadString();
                s.Write("\noperation = " + operation);
            }
            catch (System.IO.IOException)
            {
                Debug.Assert(false);
            }
        }