From 5b0c52a97b11ffebf7f71326de53889db12af681 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 29 Apr 2019 15:46:40 -0600 Subject: [PATCH] don't dangle --- src/tcp/tcp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index cb3624a..1e11b62 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -162,7 +162,7 @@ func clientCommuncation(port string, c *comm.Comm) (err error) { // chanFromConn creates a channel from a Conn object, and sends everything it // Read()s from the socket to the channel. func chanFromConn(conn net.Conn) chan []byte { - c := make(chan []byte) + c := make(chan []byte, 1) go func() { b := make([]byte, TCP_BUFFER_SIZE) @@ -181,6 +181,7 @@ func chanFromConn(conn net.Conn) chan []byte { break } } + log.Debug("exiting") }() return c