Exemple #1
0
 internal Current(ObjectAdapter adapter, IncomingRequestFrame request, int requestId,
                  Connection?connection = null)
 {
     Adapter      = adapter;
     Connection   = connection;
     Context      = new Dictionary <string, string>(request.Context);
     Encoding     = request.Encoding;
     Facet        = request.Facet;
     Identity     = request.Identity;
     IsIdempotent = request.IsIdempotent;
     Operation    = request.Operation;
     RequestId    = requestId;
 }
Exemple #2
0
        /// <summary>Forwards an incoming request to another Ice object.</summary>
        /// <param name="proxy">The proxy for the target Ice object.</param>
        /// <param name="request">The incoming request frame.</param>
        /// <param name="progress">Sent progress provider.</param>
        /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
        /// <returns>A task holding the response frame.</returns>
        public static async ValueTask <OutputStream> ForwardAsync(this IObjectPrx proxy,
                                                                  IncomingRequestFrame request,
                                                                  IProgress <bool>?progress = null,
                                                                  CancellationToken cancel  = default)
        {
            var forwardedRequest = new OutgoingRequestFrame(proxy, request.Current.Operation,
                                                            request.Current.IsIdempotent, request.Current.Context, request.TakePayload());

            IncomingResponseFrame response =
                await proxy.InvokeAsync(forwardedRequest, oneway : request.Current.IsOneway, progress, cancel)
                .ConfigureAwait(false);

            return(new OutgoingResponseFrame(request.Current, response.ReplyStatus, response.TakePayload()));
        }