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 a string packet.
BroadcastBroadcasts a packet to all connected peers using an ENetPacket.
DisconnectDisconnects a specific peer.
DisconnectDisconnects all peers and stops listening.
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, taking in a parameter that asks for how long to wait for events in milliseconds.
PollPools the server pool of peers. This variation of the Poll method does not wait for events.

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 = 1.6A version constant returning version of the plugin to aid conditional compile macros.

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM