summaryrefslogtreecommitdiff
path: root/sw-client/src/commonMain
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-05-26 02:51:10 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-05-26 02:51:10 +0200
commit5570902fb1ae05362fb594320bfe63638455c441 (patch)
tree94d4b6c68f560d71345aa10c90734aa6f597d555 /sw-client/src/commonMain
parentAdd other players' board summary (diff)
downloadseven-wonders-5570902fb1ae05362fb594320bfe63638455c441.tar.gz
seven-wonders-5570902fb1ae05362fb594320bfe63638455c441.tar.bz2
seven-wonders-5570902fb1ae05362fb594320bfe63638455c441.zip
Add heart beats to SW client to avoid disconnections on Heroku
Diffstat (limited to 'sw-client/src/commonMain')
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
index 5193f618..e904986a 100644
--- a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
+++ b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
@@ -8,6 +8,7 @@ import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.builtins.list
import kotlinx.serialization.builtins.serializer
import org.hildan.krossbow.stomp.StompClient
+import org.hildan.krossbow.stomp.config.HeartBeat
import org.hildan.krossbow.stomp.conversions.kxserialization.StompSessionWithKxSerialization
import org.hildan.krossbow.stomp.conversions.kxserialization.convertAndSend
import org.hildan.krossbow.stomp.conversions.kxserialization.subscribe
@@ -25,7 +26,9 @@ import org.luxons.sevenwonders.model.cards.PreparedCard
class SevenWondersClient {
- private val stompClient = StompClient()
+ private val stompClient = StompClient {
+ heartBeat = HeartBeat(10000, 15000)
+ }
suspend fun connect(serverUrl: String): SevenWondersSession {
val session = stompClient.connect("$serverUrl$SEVEN_WONDERS_WS_ENDPOINT").withJsonConversions()
bgstack15