[ws-client] write normal close message

This commit is contained in:
Anton Kaliaev 2017-08-08 16:02:37 -04:00
parent 6c85e4be4f
commit 8267920749
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
1 changed files with 2 additions and 2 deletions

View File

@ -324,7 +324,7 @@ func (c *WSClient) writeRoutine() {
case <-c.readRoutineQuit:
return
case <-c.Quit:
c.conn.WriteMessage(websocket.CloseMessage, []byte{})
c.conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
return
}
}
@ -352,7 +352,7 @@ func (c *WSClient) readRoutine() {
for {
_, data, err := c.conn.ReadMessage()
if err != nil {
if !websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) {
if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
return
}