Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
PacketPeerDTLS
Hereda: PacketPeer < RefCounted < Object
Paquete de pares DTLS.
Descripción
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étodos
connect_to_peer(packet_peer: PacketPeerUDP, hostname: String, client_options: TLSOptions = null) |
|
void |
|
get_status() const |
|
void |
poll() |
Enumeraciones
enum Status: 🔗
Status STATUS_DISCONNECTED = 0
Un estado que representa un PacketPeerDTLS que está desconectado.
Status STATUS_HANDSHAKING = 1
Un estado que representa un PacketPeerDTLS que está actualmente realizando el establecimiento de comunicación con un par remoto.
Status STATUS_CONNECTED = 2
Un estado que representa un PacketPeerDTLS que está conectado a un par remoto.
Status STATUS_ERROR = 3
Un estado que representa un PacketPeerDTLS en un estado de error genérico.
Status STATUS_ERROR_HOSTNAME_MISMATCH = 4
Un estado de error que muestra una falta de coincidencia en el dominio del certificado DTLS presentado por el host y el dominio solicitado para la validación.
Descripciones de Métodos
Error connect_to_peer(packet_peer: PacketPeerUDP, hostname: String, client_options: TLSOptions = null) 🔗
Conecta un packet_peer comenzando el handshake DTLS usando el PacketPeerUDP subyacente, el cual debe estar conectado (véase PacketPeerUDP.connect_to_host()). Opcionalmente, puedes especificar las client_options a usar mientras verificas las conexiones TLS. Véase TLSOptions.client() y TLSOptions.client_unsafe().
void disconnect_from_peer() 🔗
Desconecta este par, terminando la sesión de DTLS.
Devuelve el estado de la conexión.
void poll() 🔗
Sondea la conexión para comprobar si hay paquetes entrantes. Llama a esto con frecuencia para actualizar el estado y mantener la conexión en funcionamiento.