From 3ed036b51db13c00f90cdef1f2f74e3c02359dc2 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 20 Apr 2020 12:30:07 -0700 Subject: [PATCH] bug fix: increase deadline for reading in channels, addresses #211 --- src/tcp/tcp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index 420ab053..e2927ab0 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -317,10 +317,10 @@ func (s *server) deleteRoom(room string) { // Read()s from the socket to the channel. func chanFromConn(conn net.Conn) chan []byte { c := make(chan []byte, 1) + conn.SetReadDeadline(time.Now().Add(3 * time.Hour)) go func() { b := make([]byte, models.TCP_BUFFER_SIZE) - for { n, err := conn.Read(b) if n > 0 {