Skip to content
0.2.0-dev Download ZIP
59 lines ·3.1 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="PacketPeerDTLS" inherits="PacketPeer" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 DTLS packet peer.
5 </brief_description>
6 <description>
7 This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by [method DTLSServer.take_connection].
8 [b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using remote deploy. Otherwise, network communication of any kind will be blocked by Android.
9 [b]Warning:[/b] 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.
10 </description>
11 <tutorials>
12 </tutorials>
13 <methods>
14 <method name="connect_to_peer">
15 <return type="int" enum="Error" />
16 <param index="0" name="packet_peer" type="PacketPeerUDP" />
17 <param index="1" name="hostname" type="String" />
18 <param index="2" name="client_options" type="TLSOptions" default="null" />
19 <description>
20 Connects a [param packet_peer] beginning the DTLS handshake using the underlying [PacketPeerUDP] which must be connected (see [method PacketPeerUDP.connect_to_host]). You can optionally specify the [param client_options] to be used while verifying the TLS connections. See [method TLSOptions.client] and [method TLSOptions.client_unsafe].
21 </description>
22 </method>
23 <method name="disconnect_from_peer">
24 <return type="void" />
25 <description>
26 Disconnects this peer, terminating the DTLS session.
27 </description>
28 </method>
29 <method name="get_status" qualifiers="const">
30 <return type="int" enum="PacketPeerDTLS.Status" />
31 <description>
32 Returns the status of the connection.
33 </description>
34 </method>
35 <method name="poll">
36 <return type="void" />
37 <description>
38 Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working.
39 </description>
40 </method>
41 </methods>
42 <constants>
43 <constant name="STATUS_DISCONNECTED" value="0" enum="Status">
44 A status representing a [PacketPeerDTLS] that is disconnected.
45 </constant>
46 <constant name="STATUS_HANDSHAKING" value="1" enum="Status">
47 A status representing a [PacketPeerDTLS] that is currently performing the handshake with a remote peer.
48 </constant>
49 <constant name="STATUS_CONNECTED" value="2" enum="Status">
50 A status representing a [PacketPeerDTLS] that is connected to a remote peer.
51 </constant>
52 <constant name="STATUS_ERROR" value="3" enum="Status">
53 A status representing a [PacketPeerDTLS] in a generic error state.
54 </constant>
55 <constant name="STATUS_ERROR_HOSTNAME_MISMATCH" value="4" enum="Status">
56 An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation.
57 </constant>
58 </constants>
59</class>