Back to Socket Io Client Swift

SocketPacket

docs/Structs/SocketPacket.html

16.1.11.9 KB
Original Source

SocketPacket

public struct SocketPacket : CustomStringConvertible

A struct that represents a socket.io packet.

Properties

`

                nsp
                `

The namespace for this packet.

Declaration

Swift

public let nsp: String

`

                id
                `

If > 0 then this packet is using acking.

Declaration

Swift

public let id: Int

`

                type
                `

The type of this packet.

Declaration

Swift

public let type: PacketType

`

                binary
                `

An array of binary data for this packet.

Declaration

Swift

public internal(set) var binary: [Data] { get }

`

                data
                `

The data for this event.

Note: This includes all data inside of the socket.io packet payload array, which includes the event name for event type packets.

Declaration

Swift

public internal(set) var data: [Any] { get }

`

                args
                `

Returns the payload for this packet, minus the event name if this is an event or binaryEvent type packet.

Declaration

Swift

public var args: [Any] { get }

`

                description
                `

A string representation of this packet.

Declaration

Swift

public var description: String { get }

`

                event
                `

The event name for this packet.

Declaration

Swift

public var event: String { get }

`

                packetString
                `

A string representation of this packet.

Declaration

Swift

public var packetString: String { get }

PacketType enum

`

                PacketType
                `

The type of packets.

See more

Declaration

Swift

enum PacketType : Int