Table of Contents

Class PacketPeerDTLS

DTLS packet peer.

Inheritance
PacketPeerDTLS

Remarks

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

connect_to_peer(PacketPeerUDP, String, TLSOptions)

Connects a packet_peer beginning the DTLS handshake using the underlying PacketPeerUDP which must be connected (see PacketPeerUDP.connect_to_host). You can optionally specify the client_options to be used while verifying the TLS connections. See TLSOptions.client and TLSOptions.client_unsafe.

int connect_to_peer(PacketPeerUDP packet_peer, String hostname, TLSOptions client_options)

Parameters

packet_peer PacketPeerUDP
hostname String
client_options TLSOptions

disconnect_from_peer

Disconnects this peer, terminating the DTLS session.

void disconnect_from_peer

get_status

Qualifiers: const

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

int get_status

poll

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

void poll