class WebSocketHandler
Main handler class
companion object Companion : KLogging
Logging companion |
WebSocketHandler(app: Javalin, signallingService: ClientService)
sets up the WebSocket path and various handlers |
val clients: ConcurrentHashMap<String, IInternalClient>
Map of session ID to InternalClient |
|
val sessions: ConcurrentHashMap<String, WsSession>
Map of session ID to WebSocket session |
|
val signallingService: ClientService
the underlying ClientService |
fun close(session: WsSession, reason: String): Unit
Handler for when a WebSocket session closes |
|
fun connect(session: WsSession): Unit
Handler for new WebSocket connections |
|
fun onReceiveMessageFromSignaling(message: ClientMessage): Unit
Handler for a new message from the P2P layer |
|
fun onReceiveMessageFromWebSocket(session: WsSession, message: String): Unit
Handler for a new message from the WebSocket |