[ENet-discuss] Multiple events for single frame

Ruud van Gaal ruud at racer.nl
Wed Sep 21 06:41:17 PDT 2016


Yes, with timeout 0 you won't stall the loop. You could optionally time it
if you're unsure, but it doesn't start waiting when timeout=0.

Ruud


On Wed, Sep 21, 2016 at 1:17 PM, Riccardo Corsi <riccardo.corsi at kairos3d.it>
wrote:

> Hi all,
>
> I'd like to implement a single-threaded polling schema, calling
> enet_host_service() every game frame as suggested in the tutorial.
>
> Now, enet_host_service() returns a single event (if any),
> so what is the correct way to handle the case in which I have received
> multiple events between 2 consecutive frames?
>
> I was thinking to call every frame something like:
> while (enet_host_service (client, & event, 0U) > 0)
> { ... }
>
> but I wonder whether this might stall the application.
> Or I can make the assumption that enet_host_service() is fast enough to
> return with timeout 0 that it's impossible to have it stalling in the loop?
>
> Thank you,
> Ricky
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20160921/7dfd710b/attachment.html>


More information about the ENet-discuss mailing list