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



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to