ENet v1.3.18
Reliable UDP networking library
|
Functions | |
void | enet_host_bandwidth_limit (ENetHost *host, enet_uint32 incomingBandwidth, enet_uint32 outgoingBandwidth) |
Adjusts the bandwidth limits of a host. More... | |
void | enet_host_bandwidth_throttle (ENetHost *host) |
void | enet_host_broadcast (ENetHost *host, enet_uint8 channelID, ENetPacket *packet) |
Queues a packet to be sent to all peers associated with the host. More... | |
void | enet_host_channel_limit (ENetHost *host, size_t channelLimit) |
Limits the maximum allowed channels of future incoming connections. More... | |
int | enet_host_check_events (ENetHost *host, ENetEvent *event) |
Checks for any queued events on the host and dispatches one if available. More... | |
void | enet_host_compress (ENetHost *host, const ENetCompressor *compressor) |
Sets the packet compressor the host should use to compress and decompress packets. More... | |
int | enet_host_compress_with_range_coder (ENetHost *host) |
Sets the packet compressor the host should use to the default range coder. More... | |
ENetPeer * | enet_host_connect (ENetHost *host, const ENetAddress *address, size_t channelCount, enet_uint32 data) |
Initiates a connection to a foreign host. More... | |
ENetHost * | enet_host_create (const ENetAddress *address, size_t peerCount, size_t channelLimit, enet_uint32 incomingBandwidth, enet_uint32 outgoingBandwidth) |
Creates a host for communicating to peers. More... | |
void | enet_host_destroy (ENetHost *host) |
Destroys the host and all resources associated with it. More... | |
void | enet_host_flush (ENetHost *host) |
Sends any queued packets on the host specified to its designated peers. More... | |
enet_uint32 | enet_host_random (ENetHost *host) |
int | enet_host_service (ENetHost *host, ENetEvent *event, enet_uint32 timeout) |
Waits for events on the host specified and shuttles packets between the host and its peers. More... | |
void enet_host_bandwidth_limit | ( | ENetHost * | host, |
enet_uint32 | incomingBandwidth, | ||
enet_uint32 | outgoingBandwidth | ||
) |
#include <host.c>
Adjusts the bandwidth limits of a host.
host | host to adjust |
incomingBandwidth | new incoming bandwidth |
outgoingBandwidth | new outgoing bandwidth |
void enet_host_broadcast | ( | ENetHost * | host, |
enet_uint8 | channelID, | ||
ENetPacket * | packet | ||
) |
#include <host.c>
Queues a packet to be sent to all peers associated with the host.
host | host on which to broadcast the packet |
channelID | channel on which to broadcast |
packet | packet to broadcast |
void enet_host_channel_limit | ( | ENetHost * | host, |
size_t | channelLimit | ||
) |
#include <host.c>
Limits the maximum allowed channels of future incoming connections.
host | host to limit |
channelLimit | the maximum number of channels allowed; if 0, then this is equivalent to ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT |
#include <protocol.c>
Checks for any queued events on the host and dispatches one if available.
host | host to check for events |
event | an event structure where event details will be placed if available |
> | 0 if an event was dispatched |
0 | if no events are available |
< | 0 on failure |
void enet_host_compress | ( | ENetHost * | host, |
const ENetCompressor * | compressor | ||
) |
#include <host.c>
Sets the packet compressor the host should use to compress and decompress packets.
host | host to enable or disable compression for |
compressor | callbacks for for the packet compressor; if NULL, then compression is disabled |
int enet_host_compress_with_range_coder | ( | ENetHost * | host | ) |
#include <compress.c>
Sets the packet compressor the host should use to the default range coder.
host | host to enable the range coder for |
ENetPeer * enet_host_connect | ( | ENetHost * | host, |
const ENetAddress * | address, | ||
size_t | channelCount, | ||
enet_uint32 | data | ||
) |
#include <host.c>
Initiates a connection to a foreign host.
host | host seeking the connection |
address | destination for the connection |
channelCount | number of channels to allocate |
data | user data supplied to the receiving host |
ENetHost * enet_host_create | ( | const ENetAddress * | address, |
size_t | peerCount, | ||
size_t | channelLimit, | ||
enet_uint32 | incomingBandwidth, | ||
enet_uint32 | outgoingBandwidth | ||
) |
#include <host.c>
Creates a host for communicating to peers.
address | the address at which other peers may connect to this host. If NULL, then no peers may connect to the host. |
peerCount | the maximum number of peers that should be allocated for the host. |
channelLimit | the maximum number of channels allowed; if 0, then this is equivalent to ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT |
incomingBandwidth | downstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. |
outgoingBandwidth | upstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. |
void enet_host_destroy | ( | ENetHost * | host | ) |
#include <host.c>
Destroys the host and all resources associated with it.
host | pointer to the host to destroy |
void enet_host_flush | ( | ENetHost * | host | ) |
#include <protocol.c>
Sends any queued packets on the host specified to its designated peers.
host | host to flush |
enet_uint32 enet_host_random | ( | ENetHost * | host | ) |
#include <host.c>
int enet_host_service | ( | ENetHost * | host, |
ENetEvent * | event, | ||
enet_uint32 | timeout | ||
) |
#include <protocol.c>
Waits for events on the host specified and shuttles packets between the host and its peers.
host | host to service |
event | an event structure where event details will be placed if one occurs if event == NULL then no events will be delivered |
timeout | number of milliseconds that ENet should wait for events |
> | 0 if an event occurred within the specified time limit |
0 | if no event occurred |
< | 0 on failure |