This commit is contained in:
xdrm-brackets 2018-05-05 23:53:06 +02:00
parent 14205a0b2e
commit 89124221fb
1 changed files with 5 additions and 5 deletions

View File

@ -173,9 +173,11 @@ func clientReader(c *client){
/* (6) Send PONG */
if msg.Type == PING {
// fmt.Printf("[reader] PING -> PONG\n")
msg.Final = true
msg.Type = PONG
c.ch.send <- *msg
if c.io.writing {
msg.Final = true
msg.Type = PONG
c.ch.send <- *msg
}
continue
}
@ -280,8 +282,6 @@ func (c *client) close(status MessageError, clientACK bool){
Data: make([]byte, 2),
}
binary.BigEndian.PutUint16(msg.Data, uint16(status))
// msg.Data = append(msg.Data, []byte("(closing)")...)
msg.Size = uint( len(msg.Data) )
/* (4) Send message */
err := msg.Send(c.io.sock)