Skip to content

Commit

Permalink
Refactor signaling server to include room cleanup functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
abdealijaroli committed Sep 25, 2024
1 parent 0d1a3cc commit 9ce0339
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/signaling/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,10 @@ func handleDisconnect(conn *websocket.Conn) {
room.mu.Unlock()
}
}

func cleanupRoom(roomID string) {
roomsMu.Lock()
delete(rooms, roomID)
roomsMu.Unlock()
log.Printf("Room %s cleaned up", roomID)
}

0 comments on commit 9ce0339

Please sign in to comment.