lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] tcp_listen_with_backlog [RAW]


From: Chris_S
Subject: Re: [lwip-users] tcp_listen_with_backlog [RAW]
Date: Mon, 27 Jul 2009 03:19:53 -0700

> That suggests that there are more accepted connections pending than are
> allowed by the selected backlog.  i.e. you've selected a certain number
> of connections to queue waiting for an accept() call, and then another
> connection has arrived, and it can't queue this one, so it drops it.

The SICS demo page has the "index.html" file and the "sics.gif" logo file to
display per page.
I have the backlog set to 5.

Sure enough, after the 3rd page refresh it stops working on the GIF, and
that is 5 file loads.
I guess that means 5 connections.

The previous connections are closed, so why does it fill up and stop?

It seems like closing never decrements the backlog count.
Something like that.  Is the way it should work?

So what does that mean?  How do you use backlog ?

Thanks, Chris.








----- Original Message ----- 
From: "Kieran Mansley" <address@hidden>
To: "Chris_S" <address@hidden>; "Mailing list for lwIP users"
<address@hidden>
Sent: Monday, July 27, 2009 3:12 AM
Subject: Re: [lwip-users] tcp_listen_with_backlog [RAW]


> On Mon, 2009-07-27 at 03:03 -0700, Chris_S wrote:
> > Well I found the source of my TCP dying on the 3rd page refresh:
> > tcp_listen()
> >
> > I had the lwipopts.h set to:
> >
> > #define TCP_LISTEN_BACKLOG                        1
> > #define TCP_DEFAULT_LISTEN_BACKLOG    5
> >
> > and the server HTTP.c module was calling "tcp_listen()"
> > That caused the problem.  It was a backlog issue.
> >
> > I set:
> >
> > #define TCP_LISTEN_BACKLOG                      0
>
> Sounds like you've got a workaround at least, but there should be no
> problem with that code.
>
> > and no problem with multiple page refreshes.
> >
> > However I then modified the server HTTP.c so it calls
> >
> > if  (TCP_LISTEN_BACKLOG==1)
> >     tcp_listen_with_backlog(pcb,backlog)
> >         else tcp_listen(pcb)
> >
> > My question is, what is the "backlog" param value suppose to be?
> > I set it to TCP_DEFAULT_LISTEN_BACKLOG.
>
> That's very odd, as tcp_listen is defined to be:
>
> #define          tcp_listen(pcb) tcp_listen_with_backlog(pcb,
TCP_DEFAULT_LISTEN_BACKLOG)
>
> so there should be no difference between the two lines in your
> modification.
>
> > So far, if I try to use the backlog function, it doesn't keep working.
> > It keeps exiting at:
> >
> > #if TCP_LISTEN_BACKLOG
> >     if (pcb->accepts_pending >= pcb->backlog) {
> >    printf("ERROR! pcb->accepts_pending >= pcb->backlog\n");
> >       return ERR_ABRT;
> >       }
> > #endif /* TCP_LISTEN_BACKLOG */
> >
> > in "tcp_listen_input()" in TCP_IN.H.
> >
> >
> > Is this backlog function not working?  Not working in Raw?
>
> That suggests that there are more accepted connections pending than are
> allowed by the selected backlog.  i.e. you've selected a certain number
> of connections to queue waiting for an accept() call, and then another
> connection has arrived, and it can't queue this one, so it drops it.
>
> Kieran
>
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]