Inheritance #

RefCounted

- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
WebRTCDataChannel

- WebRTCDataChannelExtension
Table of contents

WebRTCDataChannel #

is_refcounted, core, not_builtin_classes

Members #

var write_mode = WRITE_MODE_BINARY#

The transfer mode to use when sending outgoing packet. Either text or binary.

Methods #

func close() -> void#

Closes this data channel, notifying the other peer.

const func get_buffered_amount() -> int#

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

const func get_id() -> 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 65535 until then).

const func get_label() -> String#

Returns the label assigned to this channel during creation.

const func get_max_packet_life_time() -> int#

Returns the maxPacketLifeTime value assigned to this channel during creation.

Will be 65535 if not specified.

const func get_max_retransmits() -> int#

Returns the maxRetransmits value assigned to this channel during creation.

Will be 65535 if not specified.

const func get_protocol() -> String#

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

const func get_ready_state() -> intWebRTCDataChannel.ChannelState#

Returns the current state of this channel, see ChannelState.

const func is_negotiated() -> bool#

Returns true if this channel was created with out-of-band configuration.

const func is_ordered() -> bool#

Returns true if this channel was created with ordering enabled (default).

func poll() -> intError#

Reserved, but not used for now.

const func was_string_packet() -> bool#

Returns true if the last received packet was transferred as text. See write_mode.

Annotations #

Constants #

const WRITE_MODE_TEXT = 0 enum WriteMode#

Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.

const WRITE_MODE_BINARY = 1 enum WriteMode#

Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.

const STATE_CONNECTING = 0 enum ChannelState#

The channel was created, but it's still trying to connect.

const STATE_OPEN = 1 enum ChannelState#

The channel is currently open, and data can flow over it.

const STATE_CLOSING = 2 enum ChannelState#

The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.

const STATE_CLOSED = 3 enum ChannelState#

The channel was closed, or connection failed.

Constructors #

Enums #

WriteMode#

enum WriteMode { WRITE_MODE_TEXT = 0, WRITE_MODE_BINARY = 1, }

ChannelState#

enum ChannelState { STATE_CONNECTING = 0, STATE_OPEN = 1, STATE_CLOSING = 2, STATE_CLOSED = 3, }

Operators #

Signals #

Theme Items #

Tutorials #