ENetClient Class (console safe)
A class to make ENet client side connections.
NoteIts 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
ENetClient | Constructor that takes maximum outgoing connections and channel limit as parameters. |
Properties
Methods
Broadcast | Broadcasts a packet to all connected peers using an ENetPacket. |
Broadcast | Broadcasts a string packet to all peers. |
Connect | Connects to a host |
GetNextPeer | Used 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. |
MoveFirstPeer | Moves the the cursor that is used to loop through peers to the first peer. |
Poll | Pools the client pool of peers. This variation of the Poll method does not wait for events. |
Poll | Pools the client pool of peers, taking in a parameter that asks for how long to wait for events in milliseconds. |
Events
Connected | This event is fired when a new connection is made. |
CreateCustomPeer | Used 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. |
DataAvailable | This event is fired when packet is available if and only if there was no PacketAvailable event. |
Disconnected | This event is fired when a peer is disconnected. |
PacketAvailable | Notifies that a packet is available. |
Constants
Version = 3.0 | |
Supported Platforms:
macOS Intel 64 bitmacOS Apple SiliconWindows 32 bitWindows 64 bitWindows ARM 64 bitLinux 32 bitLinux 64 bitLinux ARM 32 bitLinux ARM 64 bitiOS