EngineIO

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

Functions

Link copied to clipboard
fun <T> decodeHttpBatch(batch: String, deserializePayload: (String) -> T): 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

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

fun <T> decodeWsFrame(text: String, deserializePayload: (String) -> T): EngineIOPacket<T>

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

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 encodeWsFrame(packet: EngineIOPacket.BinaryData): ByteString

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

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.