Beispiel #1
0
 public LightweightCallContext(LightweightRpcEndPoint endPoint, IPrincipal?user, IReadOnlyCollection <KeyValuePair <string, ImmutableArray <byte> > >?headers, CancellationToken cancellationToken)
 {
     this.EndPoint          = endPoint;
     this.User              = user;
     this.CancellationToken = cancellationToken;
     this.headers           = headers;
 }
Beispiel #2
0
        internal static async Task <TResponse> SendReceiveDatagramAsync <TRequest, TResponse>(
            LightweightRpcEndPoint endPoint,
            IRpcConnectionHandler connectionHandler,
            string operationName,
            TRequest request,
            IRpcSerializer serializer,
            CancellationToken cancellationToken = default)
            where TRequest : class
            where TResponse : class
        {
            byte[] requestData = GetRequestData(operationName, 1, request, serializer);

            var responseData = await connectionHandler.HandleDatagramAsync(endPoint, requestData, cancellationToken);

            Assert.NotNull(responseData);

            TResponse response = GetResponseFromData <TResponse>(serializer, responseData);

            return(response);
        }