Class reference

PacketPeerDTLS

Inherits PacketPeer

DTLS packet peer.

Description

This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by DTLSServer.take_connection(). 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.

Methods

void disconnect_from_peer()

Disconnects this peer, terminating the DTLS session.

int get_status() const

Returns the status of the connection.

void poll()

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

Constants

STATUS_DISCONNECTED = 0

Enum: Status

A status representing a PacketPeerDTLS that is disconnected.

STATUS_HANDSHAKING = 1

Enum: Status

A status representing a PacketPeerDTLS that is currently performing the handshake with a remote peer.

STATUS_CONNECTED = 2

Enum: Status

A status representing a PacketPeerDTLS that is connected to a remote peer.

STATUS_ERROR = 3

Enum: Status

A status representing a PacketPeerDTLS in a generic error state.

STATUS_ERROR_HOSTNAME_MISMATCH = 4

Enum: Status

An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation.

Source revision 4f5b14abade2
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.