title: having " Response stream has already been completed" when the server use WriteAsync method
body: <p>I get "Response stream has already been completed." when the server call WriteAsync() method by using pi-stream.Only when I use Thread.sleep the client sometimes can get the stream during the sleeping time.But I know that's not the solution.So plz tell me what can I do!</p>
  
  <p>I used .net core 2.2 and vs community 2019 16.2.3</p>
  
  <pre><code>                proto:
                  rpc CppyFile(stream Chunk)returns(stream Back){}
  
                  message Chunk{
                  bytes Content=1;
                  string FileName=2;
                  string Flag=3;
                  }
  
                  message Back{
                  bytes Content=1;
                  UploadStatus statue=2;
                  string Flag=3;
                  }
  
  
                  Server:
                  await responseStream.WriteAsync(new Back
                              {
                                  Content = ByteString.FromStream(stream),
                                  Flag = fname,
                                  Statue = new UploadStatus
                                  {
                                      Message = "2",
                                      Code = UploadStatusCode.Unknown
                                  }
                              });
  
  
                  client:
  
                  using (var call = client.CppyFile())
              {
  
                  try
                  {
                      await call.RequestStream.WriteAsync(chunk);
                      Console.WriteLine("Sending");
  
                          //################################################################################## here's Problem
  
                          await call.RequestStream.CompleteAsync();
                      //Thread.Sleep(8 * 1000);
                          //##################################################################################
  
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine(e);
                      throw;
                  }
  
                   var responseReaderTask = Task.Run(async () =&gt;
                  { 
                      while (await call.ResponseStream.MoveNext())
                      {
                          var note = call.ResponseStream.Current;    
                                          //get sending from server
                                          ......
  </code></pre>
  
  <p>here's the detail error.</p>
  
  <p>System.InvalidOperationException: Response stream has already been completed.
     at Grpc.Core.Internal.AsyncCallServer<code>2.CheckSendAllowedOrEarlyResult() in T:\src\github\grpc\src\csharp\Grpc.Core\Internal\AsyncCallServer.cs:line 195
     at Grpc.Core.Internal.AsyncCallBase</code>2.SendMessageInternalAsync(TWrite msg, WriteFlags writeFlags) in T:\src\github\grpc\src\csharp\Grpc.Core\Internal\AsyncCallBase.cs:line 124</p>