Ejemplo n.º 1
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);

            // For compatibility with the old FacetPath.
            string[] facetPath = istr.ReadStringArray();
            if (facetPath.Length > 1)
            {
                throw new InvalidDataException($"invalid facet path length: {facetPath.Length}");
            }
            Facet        = facetPath.Length == 0 ? "" : facetPath[0];
            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;
        }
Ejemplo n.º 2
0
        internal Current(int requestId, InputStream request, ObjectAdapter adapter, Ice.Connection?connection = null)
        {
            Adapter = adapter;
            Id      = new Identity(request);

            // For compatibility with the old FacetPath.
            string[] facetPath = request.ReadStringArray();
            if (facetPath.Length > 1)
            {
                throw new MarshalException();
            }
            Facet        = facetPath.Length == 0 ? "" : facetPath[0];
            Operation    = request.ReadString();
            IsIdempotent = request.ReadOperationMode() != OperationMode.Normal;
            Context      = request.ReadContext();
            RequestId    = requestId;
            Connection   = connection;
            Encoding     = request.StartEncapsulation();
        }
Ejemplo n.º 3
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;
        }