decode Http Batch
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.
Individual packets in batch must be delimited by the "record separator" (U+001E) character, as defined in the specification.
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.
Throws
if the given batch contains an invalid Engine.IO packet