fix: use websocket
constant to check IsCloseError
This commit is contained in:
parent
f54e8486f1
commit
34d4206f65
1 changed files with 1 additions and 3 deletions
|
@ -19,7 +19,7 @@ func ProcessServerMessages(conn *websocket.Conn, channel chan<- GoTomato.ServerM
|
||||||
for {
|
for {
|
||||||
_, message, err := conn.ReadMessage()
|
_, message, err := conn.ReadMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if websocket.IsCloseError(err, 1000) {
|
if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
|
||||||
// Ignore normal closure and exit gracefully
|
// Ignore normal closure and exit gracefully
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,5 @@ func ProcessServerMessages(conn *websocket.Conn, channel chan<- GoTomato.ServerM
|
||||||
}
|
}
|
||||||
|
|
||||||
channel <- serverMessage
|
channel <- serverMessage
|
||||||
channel <- serverMessage
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue