Documentation
¶
Overview ¶
This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by DTLSServer.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) MoreArgs() MoreArgs
- func (self Instance) Poll()
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
- type MoreArgs
- 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 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 PacketPeerUDP which must be connected (see PacketPeerUDP.ConnectToHost). You can optionally specify the 'client_options' to be used while verifying the TLS connections. See TLSOptions.Client and TLSOptions.ClientUnsafe.
func (Instance) DisconnectFromPeer ¶
func (self Instance) DisconnectFromPeer()
Disconnects this peer, terminating the DTLS session.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
type MoreArgs ¶
type MoreArgs [1]gdclass.PacketPeerDTLS
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) ConnectToPeer ¶
func (self MoreArgs) ConnectToPeer(packet_peer PacketPeerUDP.Instance, hostname string, client_options TLSOptions.Instance) error
Connects a 'packet_peer' beginning the DTLS handshake using the underlying PacketPeerUDP which must be connected (see PacketPeerUDP.ConnectToHost). You can optionally specify the 'client_options' to be used while verifying the TLS connections. See TLSOptions.Client and TLSOptions.ClientUnsafe.
type Status ¶
type Status int //gd:PacketPeerDTLS.Status
const ( // A status representing a [PacketPeerDTLS] that is disconnected. // // [PacketPeerDTLS]: https://pkg.go.dev/graphics.gd/classdb/PacketPeerDTLS StatusDisconnected Status = 0 // A status representing a [PacketPeerDTLS] that is currently performing the handshake with a remote peer. // // [PacketPeerDTLS]: https://pkg.go.dev/graphics.gd/classdb/PacketPeerDTLS StatusHandshaking Status = 1 // A status representing a [PacketPeerDTLS] that is connected to a remote peer. // // [PacketPeerDTLS]: https://pkg.go.dev/graphics.gd/classdb/PacketPeerDTLS StatusConnected Status = 2 // A status representing a [PacketPeerDTLS] in a generic error state. // // [PacketPeerDTLS]: https://pkg.go.dev/graphics.gd/classdb/PacketPeerDTLS 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 )