Example #1
0
        public ServerStreamingCall <TRequest, TResponse> Add(ServerCallContext context, TRequest request, IServerStreamWriter <TResponse> responseStream)
        {
            var call = new ServerStreamingCall <TRequest, TResponse>(context, request, responseStream);

            Add(call);
            return(call);
        }
Example #2
0
 public void Add(ServerStreamingCall <TRequest, TResponse> call)
 {
     lock (calls)
     {
         var method = call.Context.Method;
         if (Method == null)
         {
             Method = method;
         }
         else if (method != Method)
         {
             throw new ArgumentException($"Expected method {Method} instead of {method}", nameof(call));
         }
         calls.Add(call);
     }
 }