Package io.ktor.http.cio.websocket

Functions

Link copied to clipboard
fun CoroutineScope.pinger(outgoing: SendChannel<Frame>, period: Duration, timeout: Duration, pool: ObjectPool<ByteBuffer> = KtorDefaultPool): SendChannel<Frame.Pong>

Launch pinger coroutine on CoroutineScope that is sending ping every specified period to outgoing channel, waiting for and verifying client's pong frames. It is also handling timeout and sending timeout close frame

Link copied to clipboard
fun WebSockets(pingInterval: Duration?, timeout: Duration, maxFrameSize: Long, masking: Boolean): WebSockets

Properties

Link copied to clipboard
var DefaultWebSocketServerSession.pingInterval: Duration?

Ping interval or null to disable pinger. Please note that pongs will be handled despite this setting.

Link copied to clipboard
val WebSockets.pingInterval: Duration?
Link copied to clipboard
var WebSockets.WebSocketOptions.pingPeriod: Duration?
Link copied to clipboard
var DefaultWebSocketServerSession.timeout: Duration

A timeout to wait for pong reply to ping otherwise the session will be terminated immediately. It doesn't have any effect if pingInterval is null (pinger is disabled).

Link copied to clipboard
val WebSockets.timeout: Duration
Link copied to clipboard
var WebSockets.WebSocketOptions.timeout: Duration