We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca73207 commit 81e8e15Copy full SHA for 81e8e15
games-server/src/main/kotlin/net/zomis/games/server2/ws/WebClient.kt
@@ -7,11 +7,14 @@ import net.zomis.games.server2.Client
7
internal class WebClient(val conn: WsSession): Client() {
8
9
private val logger = KLoggers.logger(this)
10
+ private val lock = Any()
11
12
override fun sendData(data: String) {
- if (conn.isOpen) {
13
- logger.info("Send to $this: $data")
14
- conn.send(data)
+ synchronized(lock) {
+ if (conn.isOpen) {
15
+ logger.info("Send to $this: $data")
16
+ conn.send(data)
17
+ }
18
}
19
20
0 commit comments