aboutsummaryrefslogtreecommitdiffhomepage
path: root/host.c
diff options
context:
space:
mode:
authoreihrul <eihrul>2010-05-13 16:55:59 +0000
committereihrul <eihrul>2010-05-13 16:55:59 +0000
commit29cbf82230087db1bd16884617754dbee23e4534 (patch)
tree90722aa0d50f789f4efe158e2fd110f3d10ec523 /host.c
parent2f19182e58b0abf67c3406a4ac6c546903f5c178 (diff)
downloadenet-29cbf82230087db1bd16884617754dbee23e4534.tar.gz
enet-29cbf82230087db1bd16884617754dbee23e4534.zip
use dispatch queues to cut down on array crawling costs
Diffstat (limited to 'host.c')
-rw-r--r--host.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/host.c b/host.c
index f11ca05..8d07e80 100644
--- a/host.c
+++ b/host.c
@@ -72,13 +72,14 @@ enet_host_create (const ENetAddress * address, size_t peerCount, enet_uint32 inc
host -> recalculateBandwidthLimits = 0;
host -> mtu = ENET_HOST_DEFAULT_MTU;
host -> peerCount = peerCount;
- host -> lastServicedPeer = host -> peers;
host -> commandCount = 0;
host -> bufferCount = 0;
host -> receivedAddress.host = ENET_HOST_ANY;
host -> receivedAddress.port = 0;
host -> receivedDataLength = 0;
+ enet_list_clear (& host -> dispatchQueue);
+
for (currentPeer = host -> peers;
currentPeer < & host -> peers [host -> peerCount];
++ currentPeer)
@@ -92,6 +93,7 @@ enet_host_create (const ENetAddress * address, size_t peerCount, enet_uint32 inc
enet_list_clear (& currentPeer -> sentUnreliableCommands);
enet_list_clear (& currentPeer -> outgoingReliableCommands);
enet_list_clear (& currentPeer -> outgoingUnreliableCommands);
+ enet_list_clear (& currentPeer -> dispatchedCommands);
enet_peer_reset (currentPeer);
}