PacketPeerDTLS
Hérite de : PacketPeer < RefCounted < Object
Homologue du paquet DTLS.
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.
Méthodes
connect_to_peer(packet_peer: PacketPeerUDP, hostname: String, client_options: TLSOptions = null) |
|
void |
|
get_status() const |
|
void |
poll() |
Énumérations
enum Status: 🔗
Status STATUS_DISCONNECTED = 0
Un status représentant un PacketPeerDTLS qui est déconnecté.
Status STATUS_HANDSHAKING = 1
Un statut représentant un PacketPeerDTLS qui effectue actuellement la poignée de main avec un pair distant.
Status STATUS_CONNECTED = 2
Un status représentant un PacketPeerDTLS qui est connecté à un pair distant.
Status STATUS_ERROR = 3
Un status représentant un PacketPeerDTLS dans un état d'erreur générique.
Status STATUS_ERROR_HOSTNAME_MISMATCH = 4
Un statut d'erreur qui montre une erreur dans le domaine de certificat DTLS présenté par l'hôte et le domaine demandé pour validation.
Descriptions des méthodes
Error connect_to_peer(packet_peer: PacketPeerUDP, hostname: String, client_options: TLSOptions = null) 🔗
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().
void disconnect_from_peer() 🔗
Déconnecte ce pair, finissant la session DTLS.
Renvoie le statut de la connexion.
void poll() 🔗
Sondez la connexion pour vérifier les paquets entrants. Appelez cela fréquemment pour mettre à jour le statut et garder la connexion fonctionnelle.