Slide 13
Slide 13 text
3PPNཧ
class Room {
var connections: [String: [WebSocket]]
func add(ws: WebSocket, room: String) {
... // adding WebSocket to connections
}
func send(ws: WebSocket, room: String, text: String) {
... // broadcast to connections
}
init() {
connections = [:]
}
}
Sources/App/Room.swift