call Stream.CloseWrite right after writing

This commit is contained in:
hanabi1224
2022-12-16 17:22:53 +08:00
parent 425d8a7fcf
commit 6ae7cdab64
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -158,6 +158,7 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
if err := cborutil.WriteCborRPC(s, hmsg); err != nil {
return xerrors.Errorf("writing rpc to peer: %w", err)
}
s.CloseWrite()
go func() {
defer s.Close() //nolint:errcheck