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

aeruhxi

03/02/2018, 6:07 AM
is ping/pong in websocket handled automatically in ktor?
o

orangy

03/02/2018, 6:16 AM
Yes, but you need to enable it
a

aeruhxi

03/02/2018, 6:18 AM
Copy code
install(WebSockets) {
        pingPeriod = Duration.ofMinutes(5)
    }
Is this it?
c

cy

03/02/2018, 7:17 AM
Note that setting
pingPeriod
enables server to client ping while client side pings are handled automatically unless you have raw websocket (responding and instance of
WebSocketUpgrade
starts raw websocket as well)
a

aeruhxi

03/02/2018, 8:31 AM
I see. Thanks!
36 Views