add close case (payload size = 0)
This commit is contained in:
parent
0ed39dec0e
commit
09b3cc8921
|
@ -118,6 +118,8 @@ func (c *T) reader(unregister chan <-*T){
|
||||||
// fmt.Printf(" [reader] sent PONG back\n")
|
// fmt.Printf(" [reader] sent PONG back\n")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
} else if msg.Size == 0 && ( msg.Type == message.TEXT || msg.Type == message.BINARY ) {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (3) Dispatch to receiver */
|
/* (3) Dispatch to receiver */
|
||||||
|
@ -127,6 +129,7 @@ func (c *T) reader(unregister chan <-*T){
|
||||||
|
|
||||||
// return closing callback
|
// return closing callback
|
||||||
c.Ch.Close <- func(){
|
c.Ch.Close <- func(){
|
||||||
|
|
||||||
unregister <- c
|
unregister <- c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue