[ENet-discuss] totally flush the outgoing commands list

Thorbjørn Lindeijer bjorn at lindeijer.nl
Wed Sep 11 03:51:10 PDT 2013


On Wed, Sep 11, 2013 at 12:28 PM, Lee Salzman <lsalzman at gmail.com> 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


More information about the ENet-discuss mailing list