Skip to content

Commit 9122c46

Browse files
committed
Merge branch 'master' into ipv6
2 parents b3f2bf9 + b8ae4a1 commit 9122c46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/tutorial.dox

+9
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ enet_host_service() will return immediately if there are no events to
127127
dispatch. enet_host_service() will return 1 if an event was dispatched
128128
within the specified timeout.
129129

130+
Beware that most processing of the network with the ENet stack is done
131+
inside enet_host_service(). Both hosts that make up the sides of a connection
132+
must regularly call this function to ensure packets are actually sent and
133+
received. A common symptom of not actively calling enet_host_service()
134+
on both ends is that one side receives events while the other does not.
135+
The best way to schedule this activity to ensure adequate service is, for
136+
example, to call enet_host_service() with a 0 timeout (meaning non-blocking)
137+
at the beginning of every frame in a game loop.
138+
130139
Currently there are only four types of significant events in ENet:
131140

132141
An event of type ENET_EVENT_TYPE_NONE is returned if no event occurred

0 commit comments

Comments
 (0)