MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / RemoteWebSocket

Class RemoteWebSocket

src/main/java/fielded/boxbrowser/RemoteWebSocket.kt:7–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import java.io.IOException
6
7class RemoteWebSocket @Throws(IOException::class)
8constructor(val httpPort: Int, val websocketPort: Int) {
9
10 val s: Server
11
12 val messages = mutableMapOf<String, MutableList<String>>()
13
14 init {
15 this.s = Server(httpPort, websocketPort)
16
17 s.addHandlerLast { server, socket, address, payload ->
18 println("message from $socket is $payload")
19 payload
20 }
21
22 }
23
24 fun send(v: String) {
25 s.broadcast(v)
26 }
27
28}

Callers

nothing calls this directly

Calls 2

ServerClass · 0.85
addHandlerLastMethod · 0.80

Tested by

no test coverage detected