From f6afd637b859809a3b955da8097586428226d2dc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 8 Mar 2018 09:46:56 -0800 Subject: [PATCH] make sure to *fully* close streams We need to wait for the EOF from the other side when closing from the sending side (unless we've already seen an EOF). --- comm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comm.go b/comm.go index 5d05e09..430e6a6 100644 --- a/comm.go +++ b/comm.go @@ -70,7 +70,7 @@ func (p *PubSub) handleSendingMessages(ctx context.Context, s inet.Stream, outgo return bufw.Flush() } - defer s.Close() + defer inet.FullClose(s) for { select { case rpc, ok := <-outgoing: