EngineIO

The Engine.IO decoder, following the Engine.IO protocol.

Functions

Link copied to clipboard
fun <T> decodeHttpBatch(batch: String, deserializeTextPayload: (String) -> T, deserializeBinaryPayload: (ByteString) -> T = { deserializeTextPayload(it.decodeToString()) }): List<EngineIOPacket<T>>

Decodes the given batch text as a batch of EngineIOPackets.

Link copied to clipboard

Decodes the given textFrame as a single EngineIOPacket.

Link copied to clipboard
fun <T> decodeWsFrame(text: String, deserializePayload: (String) -> T): EngineIOPacket<T>

Decodes the given web socket text frame as a single EngineIOPacket.

fun <T> decodeWsFrame(bytes: ByteString, deserializePayload: (ByteString) -> T): EngineIOPacket.Message<T>

Decodes the given binary web socket frame's bytes as a single EngineIOPacket.Message.

Link copied to clipboard
fun <T> encodeHttpBatch(packets: List<EngineIOPacket<T>>, serializePayload: (T) -> String): String

Encodes the given list of EngineIO packets to a text, which can be used as the body of an HTTP batch request.

Link copied to clipboard

Encodes the given SocketIO packet (wrapped in an EngineIO packet) as a string.

Link copied to clipboard
fun <T> encodeWsFrame(packet: EngineIOPacket<T>, serializePayload: (T) -> String): String

Encodes the given EngineIOPacket to a string, which can be used as a text web socket frame body.