From adb8b71fd10754b46ac20803b21cf740a8f65345 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 13 Apr 2018 19:43:14 +0900 Subject: [PATCH] ing --- socket/readwrite.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/socket/readwrite.go b/socket/readwrite.go index b2cc7d5..fc644de 100644 --- a/socket/readwrite.go +++ b/socket/readwrite.go @@ -10,8 +10,7 @@ import ( func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-chan struct{}, doneChan chan<- error, readChan chan<- []byte) { var ( - message []byte - err error + err error ) defer func() { @@ -37,6 +36,7 @@ func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-ch }) for { + var message []byte readMessageChan := make(chan struct{}) go func() { @@ -46,7 +46,6 @@ func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-ch select { case <-stopChan: - <-readMessageChan return case <-readMessageChan: }