Replies: 3 comments 10 replies
-
Hi Dipesh, thanks for reaching out. What is the problem you're noticing exactly? Does it hang? If yes, I think the problem lies in how you're expecting the first message here. When you use You could try swapping the Another possibility would be to start waiting for the first message concurrently using |
Beta Was this translation helpful? Give feedback.
-
Regarding this, the way it currently works is that the call to This is not ideal to handle reconnections, I know. Sorry! I'll work on some solution to fix this properly in #102 |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your kind reply.😊 |
Beta Was this translation helpful? Give feedback.
-
Hello @joffrey-bion,
I am having trouble subscribing to a STOMP server in my KMM project. I am trying to connect and subscribe. But i am not receiving any messages. To make sure it is not a server side issue, I also tested using "com.github.NaikSoftware:StompProtocolAndroid" library in my native android project. There I was able to subscribe and received messages from the server.
Here is my code for establishing connection
class WebSocketService {
val httpClient = HttpClient {
install(WebSockets)
}
private val stompConfig = StompConfig().apply {
heartBeat = HeartBeat(10000L.milliseconds, 10000L.milliseconds)
}
}
this is my code form viewModel
class MainViewModel : BaseKMMViewModel() {
fun connect() {
viewModelScope.coroutineScope.launch {
WebSocketService.instance.connect()
}
}
}
This is my implementation for establishing connection and subscribe. And could you suggest me idea on how to check connection state. For eg, check connected , Disconneted status.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions