Mainly theoretical, but it can keep the host from being overwhelmed by a
constant stream of socket traffic since it ensures that it's all done upfront.
It just gives a bit stricter guarantee about when certain things are done each
frame.
On 09/11/2013 01:51 PM, Thorbjørn Lindeijer wrote:
On Wed, Sep 11, 2013 at 12:28 PM, Lee Salzman <[email protected]> wrote:
There is a function enet_host_check_events() designed to work around this
problem - it just returns events from the event queue and instead of hitting
the socket when the event queue is empty, it just does nothing. So assuming
you start with an empty event queue on each frame, first you call
enet_host_service() which will do its thing to the socket, and then
continually call enet_host_check_events() till there are no more events
left.
Hmm, are you saying that it would be a good idea not to keep hitting
the socket? At the moment I'm doing like in the tutorial, but every
100 ms:
while (enet_host_service(mHost, &event, 0) > 0) {
And what you are suggesting would be to change that to:
enet_host_service(mHost, 0, 0);
while (enet_host_check_events(mHost, &event) > 0) {
But I guess it doesn't matter much? I wonder a little if there was
maybe some other purpose of this separation.
Regards,
Bjørn
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss