decodeHttpBatch

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

Decodes the given batch text as a batch of EngineIOPackets.

If a packet is a EngineIOPacket.Message packet, the payload text is deserialized using the provided deserializeTextPayload function. If the payload is binary, is it deserialized using deserializeBinaryPayload instead. By default, deserializeBinaryPayload will decode the binary data as UTF-8 text.

This is meant to be used in HTTP long-polling mode, where packets are batched in a single HTTP response. When using web sockets, use decodeWsFrame on each frame instead.