public CalculatorDuplexCallbackStreamHandler(ICalculatorDuplexClientCallback callback, IClientStreamWriter <Protos.CalculatorDuplexAction> requestStream, IAsyncStreamReader <Protos.CalculatorDuplexCallback> responseStream)
 {
     _callback           = callback;
     _requestStream      = requestStream;
     _responseStream     = responseStream;
     _pendingCompletions = new PendingCompletionStore(TimeSpan.FromMinutes(1));
 }
Exemple #2
0
        public CalculatorDuplexClient(string url, ICalculatorDuplexClientCallback callback)
        {
#if (NETSTANDARD2_1)
            var channel = GrpcChannel.ForAddress(url);
            _client = new Protos.CalculatorDuplex.CalculatorDuplexClient(channel);
#else
            var uri     = new Uri(url);
            var channel = new Channel(uri.Host, uri.Port, ChannelCredentials.Insecure);
            _client = new Protos.CalculatorDuplex.CalculatorDuplexClient(channel);
#endif
            _callback = callback ?? throw new ArgumentNullException(nameof(callback));
        }
Exemple #3
0
 public CalculatorDuplexClient(Protos.CalculatorDuplex.CalculatorDuplexClient client, ICalculatorDuplexClientCallback callback)
 {
     _client   = client ?? throw new ArgumentNullException(nameof(client));
     _callback = callback ?? throw new ArgumentNullException(nameof(callback));
 }