lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Incoming packets not seen by lwip_select on second acce


From: Joe Bloggs84
Subject: Re: [lwip-users] Incoming packets not seen by lwip_select on second accept
Date: Wed, 18 Jan 2012 19:57:35 +1100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1



On 18/01/2012 6:29 PM, Simon Goldschmidt wrote:
Ian Wilson<address@hidden>  wrote:
This all works for the first connection.  The problem is that incoming
packets are not "detected" by lwip_select for subsequent connections to
the listener (after closing the first connection of course).
[..]
Is this something obvious? If not I will provide some code and wireshark
and lwip debug logs.

Any suggestions on the best lwip debug settings that would help detect
where the problem is?
No obvious errors come to mind and I don't have any obvious debug settings for 
you, either. If it helps, select relies on two things: a counter to know when 
to wake threads (increased on rx packets, decreased when reading I think) and a 
linked list of semaphores to wake the threads (there's only one thread in the 
list for you). If there's something wrong in that code, select doesn't work 
although you could actually read data.

It would highly help to know if just reading data works, i.e. if select isn't 
working or if there's no data coming in. For that, you could set a receive 
timeout and just call recv every time select times out.

Simon

Simon,  thanks.

I have solved the (embarrassing) problem.

While implementing some hacks to test your idea of whether the data was present and it was just select that was failing I came to the realisation that I had the first parameter of lwip_select wrong - I had read the docs (quickly) as it being the count+1 of the number of fd rather than "one more than the maximum fd value". On the first connection, lwip gave the accepted socket an fd==1 so it worked. On the second fd==2 etc - so the lwip_select was not inspecting the full range of fd present.

Sorted now.  Silly me.  Thanks,
Ian



reply via email to

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