[ENet-discuss] 4 seconds stalls.. congestion problem?

Mark Palkow palkow at daviko.com
Sun Nov 21 14:31:44 PST 2010


Couldn't the problem be  

while( enet_host_service (client, & event, 0) > 0 )

because it takes all the CPU (100%)?
shouldn't it be something like:

while( enet_host_service (client, & event, 10) > 0 )

so that the CPU gets a chance to handle other task like the network stack?
regards Mark



-----Ursprüngliche Nachricht-----
Von: enet-discuss-bounces at cubik.org [mailto:enet-discuss-bounces at cubik.org]
Im Auftrag von Chris Meub
Gesendet: Sonntag, 21. November 2010 08:39
An: Discussion of the ENet library
Betreff: Re: [ENet-discuss] 4 seconds stalls.. congestion problem?

I am doing this every 1/60th second:

   while( enet_host_service (client, & event, 0) > 0 )
   {
         switch (event.type)
         {
		case ENET_EVENT_TYPE_RECEIVE:
		        // ( handle packet )
			enet_packet_destroy (event.packet);
			break;
                case ENET_EVENT_TYPE_DISCONNECT: // (handle disconnect here)
	 }
   }

As I understand it that will process all available events.

On Sat, Nov 20, 2010 at 9:47 PM, Lee Salzman <lsalzman at gmail.com> wrote:
> In the client, make sure you repeatedly call enet_host_service() until it
> returns no events, otherwise it may possibly not service the network at
all
> if it gets backlogged.
>
> Lee
>
> On 11/20/2010 07:41 PM, Chris Meub wrote:
>
> It does *not* exhibit the stalling behavior when I run on LAN or on
> the same machine.
>
> On Sat, Nov 20, 2010 at 6:44 PM, Jay Sprenkle <jsprenkle at gmail.com> wrote:
>
>
> Have you tried running both on the same physical machine, or on two
machines
> within your control?
> Perhaps it's caused by comcast equipment.
>
> On Sat, Nov 20, 2010 at 6:52 PM, Chris Meub <chrismeub at gmail.com> wrote:
>
>
> The server is hosted on a dedicated hosting provider M5, but I have
> also tried putting the server on a friend's home Ubuntu server with
> the exact same intermittent stalling behavior.
>
> The client is under a router and cable modem with comcast
>
> pinging the server averages 49ms at the moment, 32ms from another
> network ive tested
>
>
>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
_______________________________________________
ENet-discuss mailing list
ENet-discuss at cubik.org
http://lists.cubik.org/mailman/listinfo/enet-discuss



More information about the ENet-discuss mailing list