PacketPeerDTLS

package
v0.0.0-...-5fa07e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package PacketPeerDTLS provides methods for working with PacketPeerDTLS object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsPacketPeerDTLS() Instance
}

type Instance

type Instance [1]gdclass.PacketPeerDTLS

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]. [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 one-click deploy. Otherwise, network communication of any kind will be blocked by Android. [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.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsPacketPeer

func (self Instance) AsPacketPeer() PacketPeer.Instance

func (Instance) AsPacketPeerDTLS

func (self Instance) AsPacketPeerDTLS() Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) ConnectToPeer

func (self Instance) ConnectToPeer(packet_peer [1]gdclass.PacketPeerUDP, hostname string) error

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].

func (Instance) DisconnectFromPeer

func (self Instance) DisconnectFromPeer()

Disconnects this peer, terminating the DTLS session.

func (Instance) GetStatus

func (self Instance) GetStatus() gdclass.PacketPeerDTLSStatus

Returns the status of the connection. See [enum Status] for values.

func (Instance) Poll

func (self Instance) Poll()

Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working.

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Status

type Status = gdclass.PacketPeerDTLSStatus //gd:PacketPeerDTLS.Status
const (
	/*A status representing a [PacketPeerDTLS] that is disconnected.*/
	StatusDisconnected Status = 0
	/*A status representing a [PacketPeerDTLS] that is currently performing the handshake with a remote peer.*/
	StatusHandshaking Status = 1
	/*A status representing a [PacketPeerDTLS] that is connected to a remote peer.*/
	StatusConnected Status = 2
	/*A status representing a [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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL