write control 수정
This commit is contained in:
@ -431,7 +431,8 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
|||||||
if conn != nil {
|
if conn != nil {
|
||||||
if room := findRoom(roomName, false); room != nil {
|
if room := findRoom(roomName, false); room != nil {
|
||||||
if conn.popRoom(room.out(conn)) == 0 {
|
if conn.popRoom(room.out(conn)) == 0 {
|
||||||
conn.WriteControl(websocket.CloseMessage, []byte("normal"), time.Time{})
|
closeMsg := websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")
|
||||||
|
conn.WriteControl(websocket.CloseMessage, closeMsg, time.Time{})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -491,7 +492,8 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
|||||||
if conn != nil {
|
if conn != nil {
|
||||||
if room := findRoom(roomName, false); room != nil {
|
if room := findRoom(roomName, false); room != nil {
|
||||||
if conn.popRoom(room.out(conn)) == 0 {
|
if conn.popRoom(room.out(conn)) == 0 {
|
||||||
conn.WriteControl(websocket.CloseMessage, []byte("normal"), time.Time{})
|
closeMsg := websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")
|
||||||
|
conn.WriteControl(websocket.CloseMessage, closeMsg, time.Time{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user