Problem with sockets layer

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

Problem with sockets layer

brivero

Hello to everybody,

I am  working with the sockets layer on a lwip stack with a port to Nucleus RTOS. A few days ago I asked a question dealing with the select function and semaphores. Further investigations have led me to discover that the select function gives up waiting for the timeval structure when I use connect previously. This sounds pretty strange, but now I am sure about that. In the same piece of code I have written a menu with 2 options. In the first one I use select after listen, and it waits the introduced value (5 seconds), all ok. But when I choose the second option, another socket is used with connect, and in the next select call I can see through debugging that no waiting takes place (the same value is used, 5 seconds). Has somebody experienced any similar problem???  Am I making any obvious mistake???

Thanks a lot for your useful 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 sockets layer

Kieran Mansley
On Thu, 2007-05-24 at 16:38 +0200, [hidden email] wrote:

>
> Hello to everybody,
>
> I am  working with the sockets layer on a lwip stack with a port to
> Nucleus RTOS. A few days ago I asked a question dealing with the
> select function and semaphores. Further investigations have led me to
> discover that the select function gives up waiting for the timeval
> structure when I use connect previously. This sounds pretty strange,
> but now I am sure about that. In the same piece of code I have written
> a menu with 2 options. In the first one I use select after listen, and
> it waits the introduced value (5 seconds), all ok. But when I choose
> the second option, another socket is used with connect, and in the
> next select call I can see through debugging that no waiting takes
> place (the same value is used, 5 seconds). Has somebody experienced
> any similar problem???  Am I making any obvious mistake???

Can you provide a summary of the socket calls made by both server and
client in the two cases?  It would help me understand what is going on.

e.g. is it something like:

Server    Client
======    ======
socket
bind
listen
          socket
          connect <server>
accept    
select          

and in the other case:

Server    Client
======    ======
socket
bind
listen
          socket
          connect <server>
accept
          select

Is there any data transfer involved?

Kieran



_______________________________________________
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 sockets layer

Frédéric BERNON
In reply to this post by brivero
Message
Sorry for you, but Simon, who have study the select code, is now in holidays, and I'm not sure that lot of developers know the current implementation.
 
But some questions:
 
1/ which lwIP release do you use?
 
2/ want kind of client/server or application do you try to do? Because, in your previous email, you wrote "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." and if I understand, you have try select as a workaround, right? Because I think that perhaps the solution is to fix the inital problem, no?
 
 
 
====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : [hidden email]r
Web Site : http://www.hymatom.fr
====================================
P Avant d'imprimer, penser à l'environnement
 
-----Message d'origine-----
De : lwip-users-bounces+frederic.bernon=[hidden email] [mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part de [hidden email]
Envoyé : jeudi 24 mai 2007 16:39
À : [hidden email]
Objet : [lwip-users] Problem with sockets layer


Hello to everybody,

I am  working with the sockets layer on a lwip stack with a port to Nucleus RTOS. A few days ago I asked a question dealing with the select function and semaphores. Further investigations have led me to discover that the select function gives up waiting for the timeval structure when I use connect previously. This sounds pretty strange, but now I am sure about that. In the same piece of code I have written a menu with 2 options. In the first one I use select after listen, and it waits the introduced value (5 seconds), all ok. But when I choose the second option, another socket is used with connect, and in the next select call I can see through debugging that no waiting takes place (the same value is used, 5 seconds). Has somebody experienced any similar problem???  Am I making any obvious mistake???

Thanks a lot for your useful help.

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

=?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?= (810 bytes) Download Attachment