Table of Contents

Class WebRtcDataChannel

Namespace
Godot
Assembly
GodotSharp.dll
[GodotClassName("WebRTCDataChannel")]
public class WebRtcDataChannel : PacketPeer, IDisposable
Inheritance
WebRtcDataChannel
Implements
Derived
Inherited Members

Properties

WriteMode

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

public WebRtcDataChannel.WriteModeEnum WriteMode { get; set; }

Property Value

WebRtcDataChannel.WriteModeEnum

Methods

Close()

Closes this data channel, notifying the other peer.

public void Close()

GetBufferedAmount()

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

public int GetBufferedAmount()

Returns

int

GetId()

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).

public int GetId()

Returns

int

GetLabel()

Returns the label assigned to this channel during creation.

public string GetLabel()

Returns

string

GetMaxPacketLifeTime()

Returns the maxPacketLifeTime value assigned to this channel during creation.

Will be 65535 if not specified.

public int GetMaxPacketLifeTime()

Returns

int

GetMaxRetransmits()

Returns the maxRetransmits value assigned to this channel during creation.

Will be 65535 if not specified.

public int GetMaxRetransmits()

Returns

int

GetProtocol()

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

public string GetProtocol()

Returns

string

GetReadyState()

Returns the current state of this channel, see WebRtcDataChannel.ChannelState.

public WebRtcDataChannel.ChannelState GetReadyState()

Returns

WebRtcDataChannel.ChannelState

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

IsNegotiated()

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

public bool IsNegotiated()

Returns

bool

IsOrdered()

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

public bool IsOrdered()

Returns

bool

Poll()

Reserved, but not used for now.

public Error Poll()

Returns

Error

WasStringPacket()

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

public bool WasStringPacket()

Returns

bool