WebSocketReader

class WebSocketReader(byteChannel: ByteReadChannel, coroutineContext: CoroutineContext, maxFrameSize: Long, pool: ObjectPool<ByteBuffer>) : CoroutineScope

Class that continuously reads a byteChannel and converts into Websocket Frame exposing them in incoming.

Parameters

maxFrameSize

maximum frame size that could be read

Constructors

Link copied to clipboard
fun WebSocketReader(byteChannel: ByteReadChannel, coroutineContext: CoroutineContext, maxFrameSize: Long, pool: ObjectPool<ByteBuffer> = KtorDefaultPool)

Types

Link copied to clipboard
class FrameTooBigException(frameSize: Long) : Exception, CopyableThrowable<WebSocketReader.FrameTooBigException>

Raised when the frame is bigger than allowed in a current websocket session

Properties

Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
val incoming: ReceiveChannel<Frame>

Channel receiving Websocket's Frame objects read from byteChannel.

Link copied to clipboard
var maxFrameSize: Long