ing
This commit is contained in:
parent
5e42fbc185
commit
adb8b71fd1
|
@ -10,7 +10,6 @@ import (
|
||||||
|
|
||||||
func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-chan struct{}, doneChan chan<- error, readChan chan<- []byte) {
|
func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-chan struct{}, doneChan chan<- error, readChan chan<- []byte) {
|
||||||
var (
|
var (
|
||||||
message []byte
|
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,6 +36,7 @@ func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-ch
|
||||||
})
|
})
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
var message []byte
|
||||||
readMessageChan := make(chan struct{})
|
readMessageChan := make(chan struct{})
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -46,7 +46,6 @@ func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-ch
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-stopChan:
|
case <-stopChan:
|
||||||
<-readMessageChan
|
|
||||||
return
|
return
|
||||||
case <-readMessageChan:
|
case <-readMessageChan:
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user