Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

ENetPacketPeer

Inherits: PacketPeer < RefCounted < Object

A wrapper class for an ENetPeer.

Description

A PacketPeer implementation representing a peer of an ENetConnection.

This class cannot be instantiated directly but can be retrieved during ENetConnection.service or via ENetConnection.get_peers.

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.

Tutorials

Methods

int

get_channels ( ) const

String

get_remote_address ( ) const

int

get_remote_port ( ) const

PeerState

get_state ( ) const

float

get_statistic ( PeerStatistic statistic )

bool

is_active ( ) const

void

peer_disconnect ( int data=0 )

void

peer_disconnect_later ( int data=0 )

void

peer_disconnect_now ( int data=0 )

void

ping ( )

void

ping_interval ( int ping_interval )

void

reset ( )

Error

send ( int channel, PackedByteArray packet, int flags )

void

set_timeout ( int timeout, int timeout_min, int timeout_max )

void

throttle_configure ( int interval, int acceleration, int deceleration )


Enumerations