Documentation
¶
Overview ¶
This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by graphics.gd/classdb/DTLSServer.Instance.TakeConnection.
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.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPacketPeer() PacketPeer.Instance
- func (self Instance) AsPacketPeerDTLS() Instance
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) ConnectToPeer(packet_peer PacketPeerUDP.Instance, hostname string) error
- func (self Instance) DisconnectFromPeer()
- func (self Instance) GetStatus() Status
- func (self Instance) ID() ID
- func (self Instance) Poll()
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
type Expanded [1]gdclass.PacketPeerDTLS
func (Expanded) ConnectToPeer ¶
func (self Expanded) ConnectToPeer(packet_peer PacketPeerUDP.Instance, hostname string, client_options TLSOptions.Instance) error
Connects a 'packet_peer' beginning the DTLS handshake using the underlying graphics.gd/classdb/PacketPeerUDP which must be connected (see graphics.gd/classdb/PacketPeerUDP.Instance.ConnectToHost). You can optionally specify the 'client_options' to be used while verifying the TLS connections. See graphics.gd/classdb/TLSOptions.Instance.Client and graphics.gd/classdb/TLSOptions.Instance.ClientUnsafe.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsPacketPeer ¶
func (self *Extension[T]) AsPacketPeer() PacketPeer.Instance
func (*Extension[T]) AsPacketPeerDTLS ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.PacketPeerDTLS
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsPacketPeer ¶
func (self Instance) AsPacketPeer() PacketPeer.Instance
func (Instance) AsPacketPeerDTLS ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) ConnectToPeer ¶
func (self Instance) ConnectToPeer(packet_peer PacketPeerUDP.Instance, hostname string) error
Connects a 'packet_peer' beginning the DTLS handshake using the underlying graphics.gd/classdb/PacketPeerUDP which must be connected (see graphics.gd/classdb/PacketPeerUDP.Instance.ConnectToHost). You can optionally specify the 'client_options' to be used while verifying the TLS connections. See graphics.gd/classdb/TLSOptions.Instance.Client and graphics.gd/classdb/TLSOptions.Instance.ClientUnsafe.
func (Instance) DisconnectFromPeer ¶
func (self Instance) DisconnectFromPeer()
Disconnects this peer, terminating the DTLS session.
type Status ¶
type Status int //gd:PacketPeerDTLS.Status
const ( // A status representing a [graphics.gd/classdb/PacketPeerDTLS] that is disconnected. StatusDisconnected Status = 0 // A status representing a [graphics.gd/classdb/PacketPeerDTLS] that is currently performing the handshake with a remote peer. StatusHandshaking Status = 1 // A status representing a [graphics.gd/classdb/PacketPeerDTLS] that is connected to a remote peer. StatusConnected Status = 2 // A status representing a [graphics.gd/classdb/PacketPeerDTLS] in a generic error state. StatusError Status = 3 // An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. StatusErrorHostnameMismatch Status = 4 )