lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] the problem continious with my TCP connection socket


From: Oscar F
Subject: Re: [lwip-users] the problem continious with my TCP connection socket
Date: Wed, 30 Sep 2009 10:27:31 +0200

Thank you very much!!!

I am going to test!!
regards

Oscar

On Wed, Sep 30, 2009 at 10:22 AM, Kieran Mansley <address@hidden> wrote:
On Tue, 2009-09-29 at 16:08 +0200, Oscar F wrote:
> sorry kieran, sorry for my english, but i don´t understand

OK, you have this:

     FD_ZERO(&acceptset);
     maxfd=0;

     for(i=0;i<NUM_SOCKET;i++)
      {
       FD_SET(lSocket[i], &acceptset);
       if (lSocket[i]> maxfd)
        maxfd = lSocket[i];
      }

     while(1){
       ret = select(maxfd+1, &acceptset, NULL, NULL, NULL);

       ...
     }


You need this instead:

     while (1) {
       FD_ZERO(&acceptset);
       maxfd=0;

       for(i=0;i<NUM_SOCKET;i++)
       {
         FD_SET(lSocket[i], &acceptset);
         if (lSocket[i]> maxfd)
           maxfd = lSocket[i];
       }

       ret = select(maxfd+1, &acceptset, NULL, NULL, NULL);

       ...
     }

because acceptset is modified by the call to select, so you need to
reset it each time you call select, so you need that code in the loop.

> Can i connect in the same task(one thread) with different TCP sockets
> with different port ?
>  socket 1 port 1500H
> socket 2 port 1501H

Yes.

Kieran



_______________________________________________
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]