https://kotlinlang.org logo
#ktor
Title
# ktor
j

jozefdransfield

08/06/2021, 8:40 AM
Hi all im trying to track down an issue with a long running websocket connection using ktor client, i send one message at the start and then im just receiving messages, in the past i have seen that the connection can get dropped, but i only get an error message when i try and send something, does anyone know if there is a way to check the connection periodically without writing something to the stream?
o

Oliver.O

08/06/2021, 12:53 PM
I did not look up the spec, but it seems like a websocket server is responsible for enabling heartbeat monitoring. Ktor server has a
pingPeriod
parameter to that effect: https://ktor.io/docs/websocket.html#installing
j

jozefdransfield

08/06/2021, 3:12 PM
thank you