Problem with lwip_select under Nucleus

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with lwip_select under Nucleus

brivero

Hello,

I´m trying to use the socket layer under Nucleus, and I hace a problem with the lwip_select function.

The fact is that I am trying to make a standard code work. In it there is a tcpserver which does create a socket, bind it, listen and when accept is done send. On the other hand I´ve got a tcpclient which does create a socket, connect to the server and receive. All works if Imake the client wait a second just before receiving. If not, the server finds no suitable connection for the time it is going to send the information actually. This means, the client finishes execution deleting the connection for when the server wants to send.


I understand that the undelaying problem is that lwip sockets are non blocking for default. Then I should use lwip_select just before receive in the client.

I´ve tried this too, but the fact is that there is something wrong with the semaphores. I´ve debugged the client application, and it can be seen how inside the select function the code follows all the logic path, seeing how no readset socket gets active, activating the semaphores and so on. Nevertheless, it is clear that the select does not wait the 5 seconds timeval parameter!

Can there be any problem with the semaphores attached to the porting or something similar?

Thank you very much for your help.


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with lwip_select under Nucleus

Kieran Mansley
On Tue, 2007-05-22 at 11:01 +0200, [hidden email] wrote:

> I understand that the undelaying problem is that lwip sockets are non
> blocking for default. Then I should use lwip_select just before
> receive in the client.  

I think the sockets API is blocking by default.  Have you tried just
doing a blocking receive rather than using select?

> Can there be any problem with the semaphores attached to the porting
> or something similar?

Sounds likely.  I suggest you contact whoever it was who did the port
and see if they can suggest what might be wrong.

Kieran



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