WebRTCDataChannel

package
v0.0.0-...-568b220 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package WebRTCDataChannel provides methods for working with WebRTCDataChannel object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsWebRTCDataChannel() Instance
}

type ChannelState

type ChannelState int //gd:WebRTCDataChannel.ChannelState
const (
	/*The channel was created, but it's still trying to connect.*/
	StateConnecting ChannelState = 0
	/*The channel is currently open, and data can flow over it.*/
	StateOpen ChannelState = 1
	/*The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.*/
	StateClosing ChannelState = 2
	/*The channel was closed, or connection failed.*/
	StateClosed ChannelState = 3
)

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsPacketPeer

func (self *Extension[T]) AsPacketPeer() PacketPeer.Instance

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsWebRTCDataChannel

func (self *Extension[T]) AsWebRTCDataChannel() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.WebRTCDataChannel
var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsPacketPeer

func (self Instance) AsPacketPeer() PacketPeer.Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsWebRTCDataChannel

func (self Instance) AsWebRTCDataChannel() Instance

func (Instance) Close

func (self Instance) Close()

Closes this data channel, notifying the other peer.

func (Instance) GetBufferedAmount

func (self Instance) GetBufferedAmount() int

Returns the number of bytes currently queued to be sent over this channel.

func (Instance) GetId

func (self Instance) GetId() int

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 [code]65535[/code] until then).

func (Instance) GetLabel

func (self Instance) GetLabel() string

Returns the label assigned to this channel during creation.

func (Instance) GetMaxPacketLifeTime

func (self Instance) GetMaxPacketLifeTime() int

Returns the [code]maxPacketLifeTime[/code] value assigned to this channel during creation. Will be [code]65535[/code] if not specified.

func (Instance) GetMaxRetransmits

func (self Instance) GetMaxRetransmits() int

Returns the [code]maxRetransmits[/code] value assigned to this channel during creation. Will be [code]65535[/code] if not specified.

func (Instance) GetProtocol

func (self Instance) GetProtocol() string

Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.

func (Instance) GetReadyState

func (self Instance) GetReadyState() ChannelState

Returns the current state of this channel, see [enum ChannelState].

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsNegotiated

func (self Instance) IsNegotiated() bool

Returns [code]true[/code] if this channel was created with out-of-band configuration.

func (Instance) IsOrdered

func (self Instance) IsOrdered() bool

Returns [code]true[/code] if this channel was created with ordering enabled (default).

func (Instance) Poll

func (self Instance) Poll() error

Reserved, but not used for now.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetWriteMode

func (self Instance) SetWriteMode(value WriteMode)

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) WasStringPacket

func (self Instance) WasStringPacket() bool

Returns [code]true[/code] if the last received packet was transferred as text. See [member write_mode].

func (Instance) WriteMode

func (self Instance) WriteMode() WriteMode

type WriteMode

type WriteMode int //gd:WebRTCDataChannel.WriteMode
const (
	/*Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.*/
	WriteModeText WriteMode = 0
	/*Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.*/
	WriteModeBinary WriteMode = 1
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL