conn 정리시 널 체크
This commit is contained in:
@ -295,10 +295,20 @@ func (ws *WebsocketHandler) mainLoop(ctx context.Context) {
|
|||||||
return room
|
return room
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shutdownConn := func(c *wsconn) {
|
||||||
|
defer func() {
|
||||||
|
r := recover()
|
||||||
|
if r != nil {
|
||||||
|
logger.Println(r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
ws.ClientDisconnected(c)
|
||||||
|
c.Close()
|
||||||
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
for _, conn := range entireConns {
|
for _, conn := range entireConns {
|
||||||
ws.ClientDisconnected(conn)
|
shutdownConn(conn)
|
||||||
conn.Close()
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user