SocketIOPacket

sealed interface SocketIOPacket(source)

A Socket.IO packet, as defined in the Socket.IO protocol.

Exact payload types can be checked against the reference implementation.

Inheritors

Types

Link copied to clipboard
data class Ack(val namespace: String, val ackId: Int, val payload: JsonArray) : SocketIOPacket.JsonMessage

Used to acknowledge the event with the corresponding ackId.

Link copied to clipboard
data class BinaryAck(val namespace: String, val ackId: Int, val payload: List<PayloadElement>, val nBinaryAttachments: Int) : SocketIOPacket.BinaryMessage

Used to acknowledge an event (when the response includes binary data).

Link copied to clipboard
data class BinaryEvent(val namespace: String, val ackId: Int?, val payload: List<PayloadElement>, val nBinaryAttachments: Int) : SocketIOPacket.BinaryMessage

Used to send binary data to the other side.

Link copied to clipboard
Link copied to clipboard
data class Connect(val namespace: String, val payload: JsonObject?) : SocketIOPacket

Used during the connection to a namespace.

Link copied to clipboard
data class ConnectError(val namespace: String, val errorData: JsonElement?) : SocketIOPacket

Used during the connection to a namespace.

Link copied to clipboard
data class Disconnect(val namespace: String) : SocketIOPacket

Used when disconnecting from a namespace.

Link copied to clipboard
data class Event(val namespace: String, val ackId: Int?, val payload: JsonArray) : SocketIOPacket.JsonMessage

Used to send data to the other side.

Link copied to clipboard

A parent for packet types having a payload.

Link copied to clipboard
sealed interface Message : SocketIOPacket

A parent for message packet types.

Properties

Link copied to clipboard
abstract val namespace: String

The namespace this packet belongs to, useful when multiplexing. The default namespace is "/".