This commit is contained in:
crusader 2018-04-13 19:43:14 +09:00
parent 5e42fbc185
commit adb8b71fd1

View File

@ -10,7 +10,6 @@ import (
func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-chan struct{}, doneChan chan<- error, readChan chan<- []byte) {
var (
message []byte
err error
)
@ -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:
}