_PacketHandshake

Inherits: Node

This class implements a handshake protocol over UDP for multiple classes.

Methods

Return Type Name
int over_packet_peer(PacketPeer peer, float timeout, float frequency)
int over_enet(ENetConnection connection, String address, int port, float timeout, float frequency)
int over_enet_peer(ENetMultiplayerPeer peer, String address, int port, float timeout, float frequency)

Method Descriptions

int over_packet_peer ( PacketPeer peer, float timeout, float frequency )

Conduct handshake over a PacketPeer instance.


int over_enet ( ENetConnection connection, String address, int port, float timeout, float frequency )

Conduct handshake over an ENetConnection.

If the connection is closed during the handshake, errors will be printed until the end of the timeout. To avoid errors, use over_enet_peer() when possible.

Note that this is not a full-fledged handshake, since we can't receive data over the connection. Instead, we just pretend that the handshake is successful on our end and blast that status for a given time.


int over_enet_peer ( ENetMultiplayerPeer peer, String address, int port, float timeout, float frequency )

Conduct handshake over an ENetMultiplayerPeer.

Compared to over_enet(), using an ENetMultiplayerPeer allows checking for closed connections. If the peer is closed during the handshake, this method will gracefully fail.

Note that this is not a full-fledged handshake, since we can't receive data over the connection. Instead, we just pretend that the handshake is successful on our end and blast that status for a given time.