lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Function set by tcp_recv() not getting called


From: JM
Subject: Re: [lwip-users] Function set by tcp_recv() not getting called
Date: Mon, 8 Mar 2010 04:09:36 -0800 (PST)

http_accept is correctly getting called when the connection is established, but I didn't put much in the function (just something to set a breakpoint on).  I was under the impression that this function is used as-needed.  So, tcp_recv should use the pcb that is passed by the function referenced by tcp_accept? 

I read that tcp_listen assigns a new pcb, but I assumed only this new pcb is used.  But now it makes sense that a new pcb will be assigned for each incoming connection; I didn't think about the multiple incoming connection situation because I will require only one.  I'll give it a try, I think this is my problem.

--- On Mon, 3/8/10, Simon Goldschmidt <address@hidden> wrote:

From: Simon Goldschmidt <address@hidden>
Subject: Re: [lwip-users] Function set by tcp_recv() not getting called
To: "Mailing list for lwIP users" <address@hidden>
Date: Monday, March 8, 2010, 2:12 AM

JM wrote:
> [..]
> pcb_web = tcp_new();
> tcp_bind(pcb_web, IP_ADDR_ANY, 80);
> pcb_web = tcp_listen(pcb_web);
> tcp_accept(pcb_web, http_accept);
> tcp_recv(pcb_web, http_recv);
> [..]
> Everytime I send data to lwIP, I see a similar output, but http_recv still
> doesn't get called.  What could I be doing wrong? 

That depends on the rest of the server. E.g., what does http_accept do? Does it get called at all? Does it set the recv callback on the connection pcb?

Oh, and setting the recv callback to the listening pcb is wrong. It might even lead to accessing invalid memory, maybe that's your problem? You should try to move the tcp_recv call into http_accept.

Simon
--
GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.!
http://portal.gmx.net/de/go/dsl02


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

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