[ENet-discuss] ENet - desconnection in 30 seconds after connection.

Nuno Silva little.coding.fox at gmail.com
Fri Nov 5 11:33:10 PDT 2010


One thing you could do is work with ENet _exclusively_ on a separate thread.
This way you can prevent issues with e.g., stuttering, or the rendering
severely lowering the network's processing.

2010/11/5 Nicholas J Ingrassellino <nick at lifebloodnetworks.com>

>  With any game-- and most real-time applications, for that matter-- you
> will always want some kind of *rest(1)* (to rest ~one millisecond). This
> saves CPU cycles, batteries, and makes fans less noisey. My latest ENet game
> does it this way:
>
> *while ( !_main_loop_exit ) {
>     while ( enet_host_service(client, &event, 0) > 0 ) {
> ...
>     }
>
>     logic();
>     display();
> **
>     rest(1);
> }
> *
>
>
> The biggest up side of ENet not wasting time waiting for something to
> happen is other time-critic sections of code have a chance to do something
> without having to wait (as is implied by this statement my application is
> single-threaded). As long as the other code does not take too long this
> allows ENet to check for a new events a hell of a lot of times each second
> (as is bound by the CPU).
>
>
> ------------------------------
>
> Nicholas J Ingrassellino
> LifebloodNetworks.com <http://www.lifebloodnetworks.com/> ||
> nick at lifebloodnetworks.com
>
> "The idea that I can be presented with a problem, set out to logically
> solve it with the tools at hand, and wind up with a program that could not
> be legally used because someone else followed the same logical steps some
> years ago and filed for a patent on it is horrifying."
> - John Carmack on software patents
>
> On 11/05/2010 12:28 PM, Вячеслав Блинников wrote:
>
> I tried to set "0" but in such case cycle with "enet_host_service()"
> consumes 100% of processor's power.
> I did not understood the phrase "I haven't noticed any performance
> issues with ENet" - you meant that there is nothing faster then ENet?
>
> 5 ноября 2010 г. 19:21 пользователь Ruud van Gaal <ruud at racer.nl> <ruud at racer.nl> написал:
>
>  I always use 0 for the enet_host_service() delay. And as for delays, I
> haven't noticed any performance issues with ENet, although I'm doing a game
> where framerate is very important.
> Ruud
>
>  _______________________________________________
> ENet-discuss mailing listENet-discuss at cubik.orghttp://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
> _______________________________________________
> 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/20101105/7f56ace8/attachment.html>


More information about the ENet-discuss mailing list