Returns the ID assigned to this channel during creation (or auto-assigned during negotiation).
If the channel is not negotiated out-of-band the ID will only be available after the connection is established (will return 65535 until then).
Returns the maxPacketLifeTime value assigned to this channel during creation.
Will be 65535 if not specified.
Returns the maxRetransmits value assigned to this channel during creation.
Will be 65535 if not specified.
Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
Returns true if the last received packet was transferred as text. See write_mode.
WRITE_MODE_TEXT = 0Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.
WRITE_MODE_BINARY = 1Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.
STATE_CONNECTING = 0The channel was created, but it's still trying to connect.
STATE_OPEN = 1The channel is currently open, and data can flow over it.
STATE_CLOSING = 2The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.
STATE_CLOSED = 3The channel was closed, or connection failed.