title: Streaming server error: rpc error: code = Unavailable desc = transport is closing"
body: <p>I have a server with gRPC stream. And after a client, who had previously subscribed on that stream, unsubscribing, I'm getting this error
  <code>rpc error: code = Unavailable desc = transport is closing</code></p>
  <p>After I've enabled more detailed logs, I saw this warning
  <code>grpc: Server.Serve failed to create ServerTransport:  connection error: desc = &quot;transport: http2Server.HandleStreams failed to receive the preface from client: EOF&quot;</code>
  And I'm getting it a couple times per second. What can be a problem?</p>
  <p>Client</p>
  <pre><code>stream, err := s.stream.GetStreamClient(metadata.AppendToOutgoingContext(ctx,&quot;key&quot;,&quot;value&quot;),&amp;sub.StreamRequest{})
  for {
     resp, err := stream.Recv()
     if err != nil {
         stream.CloseSend()
         return
  }
  ....
  }
  </code></pre>
  <p>Client can also call <code>stream.CloseSend()</code> after some timeout</p>
  <p>Server</p>
  <pre><code>GetStreamClient(req *sub.StreamRequest, stream pb.StreamClient) error { 
  for {
      err := stream.Send()
      if err != nil {
      //log error
      return
      }
    }
  } 
  </code></pre>