ktor-websockets / io.ktor.websocket / DefaultWebSocketServerSession

DefaultWebSocketServerSession

interface DefaultWebSocketServerSession : DefaultWebSocketSession, WebSocketServerSession

Represents a server-side web socket session with all default implementations

See Also

DefaultWebSocketSession

Inherited Properties

call

abstract val call: ApplicationCall

Associated received call that originating this session

Extension Properties

application

val WebSocketServerSession.application: Application

An application that started this web socket session

pingInterval

var DefaultWebSocketServerSession.pingInterval: Duration?

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

timeout

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).

Extension Functions

pinger

fun CoroutineScope.pinger(outgoing: SendChannel<Frame>, period: Duration, timeout: Duration, pool: ObjectPool<ByteBuffer> = KtorDefaultPool): SendChannel<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

pinger

fun CoroutineScope.pinger(outgoing: SendChannel<Frame>, period: <ERROR CLASS>, timeout: <ERROR CLASS>, pool: ObjectPool<ByteBuffer> = KtorDefaultPool): SendChannel<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