Table of Contents

Class PacketPeerDtls

Namespace
Godot
Assembly
GodotSharp.dll

This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by TakeConnection(PacketPeerUdp).

Note: When exporting to Android, make sure to enable the INTERNET permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.

Warning: TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period.

[GodotClassName("PacketPeerDTLS")]
public class PacketPeerDtls : PacketPeer, IDisposable
Inheritance
PacketPeerDtls
Implements
Inherited Members

Constructors

PacketPeerDtls()

public PacketPeerDtls()

Methods

ConnectToPeer(PacketPeerUdp, string, TlsOptions)

Connects a packetPeer beginning the DTLS handshake using the underlying PacketPeerUdp which must be connected (see ConnectToHost(string, int)). You can optionally specify the clientOptions to be used while verifying the TLS connections. See Client(X509Certificate, string) and ClientUnsafe(X509Certificate).

public Error ConnectToPeer(PacketPeerUdp packetPeer, string hostname, TlsOptions clientOptions = null)

Parameters

packetPeer PacketPeerUdp
hostname string
clientOptions TlsOptions

Returns

Error

DisconnectFromPeer()

Disconnects this peer, terminating the DTLS session.

public void DisconnectFromPeer()

GetStatus()

Returns the status of the connection. See PacketPeerDtls.Status for values.

public PacketPeerDtls.Status GetStatus()

Returns

PacketPeerDtls.Status

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

Poll()

Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working.

public void Poll()