ENet Xojo plugin

ENetServer Class (console safe)

A class to make ENet server that listens for ENet client 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
   ENetServer

class ENetServer

Constructors

ENetServerThe default constructor for the ENetServer host.

Properties

LastErrorReturns last error code that happened.
MaxPeerCountReturns the number of maximum allowed peers.
PeerCountReturns the number of currently 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 packet to all connected peers using a string packet.
DisconnectDisconnects all peers and stops listening.
DisconnectDisconnects a specific peer.
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.
ListenListens for ENet connections on a specific port, using specific amount of channels.
MoveFirstPeerMoves the the cursor that is used to loop through peers to the first peer.
PollPools the server pool of peers. This variation of the Poll method does not wait for events.
PollPools the server 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 PacketvAvailable 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