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

Andrew

05/30/2020, 2:02 AM
So the ktor website in its guide for websockets gives the following example:
Copy code
install(WebSockets) {
    pingPeriod = Duration.ofSeconds(60) // Disabled (null) by default
    timeout = Duration.ofSeconds(15)
    maxFrameSize = Long.MAX_VALUE // Disabled (max value). The connection will be closed if surpassed this length. 
    masking = false
}
However, this doesn't actually work (as far as I can tell), because the receiver of the lambda is the type of the first parameter of
WebSockets
, which is
Unit
. Anyone know where I went wrong?
b

bbaldino

06/01/2020, 3:52 PM
The
WebSockets
constructor has (some of) those config properties (pingInterval and maxFrameSize)
But agree
WebSockets
doesn't seem to follow the rest of the features there (which have a defined config class)
2 Views