| 5 | import java.io.IOException |
| 6 | |
| 7 | class RemoteWebSocket @Throws(IOException::class) |
| 8 | constructor(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 | } |
nothing calls this directly
no test coverage detected