diff options
author | lsalzman <[email protected]> | 2014-11-17 10:26:39 +0200 |
---|---|---|
committer | lsalzman <[email protected]> | 2014-11-17 10:26:39 +0200 |
commit | 2fb98f9b0263e3b27ad0cef1d0119d72738efcfe (patch) | |
tree | 29eeca08f621b6440f7fc8d5b315f45a66d4bb4f /docs | |
parent | 6ef4e7d277a4f9e97e24e3f3b77835f584acd9a1 (diff) | |
download | enet-2fb98f9b0263e3b27ad0cef1d0119d72738efcfe.tar.gz enet-2fb98f9b0263e3b27ad0cef1d0119d72738efcfe.zip |
added note about calling enet_host_service on both ends of a connection
Diffstat (limited to 'docs')
-rw-r--r-- | docs/tutorial.dox | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/tutorial.dox b/docs/tutorial.dox index 5dbd0c2..e91eae8 100644 --- a/docs/tutorial.dox +++ b/docs/tutorial.dox @@ -127,6 +127,15 @@ enet_host_service() will return immediately if there are no events to dispatch. enet_host_service() will return 1 if an event was dispatched within the specified timeout. +Beware that most processing of the network with the ENet stack is done +inside enet_host_service(). Both hosts that make up the sides of a connection +must regularly call this function to ensure packets are actually sent and +received. A common symptom of not actively calling enet_host_service() +on both ends is that one side receives events while the other does not. +The best way to schedule this activity to ensure adequate service is, for +example, to call enet_host_service() with a 0 timeout (meaning non-blocking) +at the beginning of every frame in a game loop. + Currently there are only four types of significant events in ENet: An event of type ENET_EVENT_TYPE_NONE is returned if no event occurred |