ENet Xojo plugin

ENetClient Class (console safe)

A class to make ENet client side connections.

Note
Its important to realise that ENet is a polling protocol, and that you will need a timer or to set up some mechanism to control the polling flow.

Object
   ENetClient

class ENetClient

Constructors

ENetClientConstructor that takes maximum outgoing connections and channel limit as parameters.

Properties

LastErrorReturns last error code that happened.
MaxPeerCountGets maximum number of connections
PeerCountGets actual number of connected peers
TotalReceivedDataGets or sets total data received.
TotalReceivedPacketsGets or sets total UDP packets received.
TotalSentDataGets or sets total data sent.
TotalSentPacketsGets or sets total UDP packets sent.

Methods

BroadcastBroadcasts a packet to all connected peers using an ENetPacket.
BroadcastBroadcasts a string packet to all peers.
ConnectConnects to a host
GetNextPeerUsed to loop through all peers. Use MoveFirstPeer to move the cursor to the first peer then use GetNextPeer to get next peer until it returns nil.
MoveFirstPeerMoves the the cursor that is used to loop through peers to the first peer.
PollPools the client pool of peers. This variation of the Poll method does not wait for events.
PollPools the client pool of peers, taking in a parameter that asks for how long to wait for events in milliseconds.

Events

ConnectedThis event is fired when a new connection is made.
CreateCustomPeerUsed this event if you want to have a class that is derived from ENetPeer that adds your own custom properties as the Peer class for the connection.
DataAvailableThis event is fired when packet is available if and only if there was no PacketAvailable event.
DisconnectedThis event is fired when a peer is disconnected.
PacketAvailableNotifies that a packet is available.

Constants

Version = 3.0

Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 32 bit
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM 32 bit
  • Linux ARM 64 bit
  • iOS