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: Tue, 29 Sep 2009 15:39:00 +0200

Hello Kieran, but i did that no?

do{
          // Check for received packets on configured sockets (blocking )
          ret = select(maxfd+1, &acceptset, NULL, NULL, NULL);

          if (ret > 0) //No error
            {
              for(i=0;i<NUM_SOCKET;i++)
              {
                 if (FD_ISSET(lSocket[i], &acceptset))
                  {
                   //connection receive ==> then accept
                   aSocket[i]= accept(lSocket[i],(struct sockaddr*)&sRemoteAddr[i],(
socklen_t *)sizeof(sRemoteAddr[i]));
                   if(aSocket[i]>0)
                    {
                       if (i<3)
                       {
                        FD_SET(aSocket[i], &readset); //Add the three socket to wait for the receive data
                        if (aSocket[i]> maxfd2)
                         maxfd2 = aSocket[i];
                       }
                       numconection++;
                    }
                   else
                      lwip_close(aSocket[i]);

                   //FD_CLR(lSocket[i], &acceptset);
                  }
                }
              }
          else
           {
               CloseConnectionPC(aSocket,lSocket );
               return;
           }
      }while ( numconection <NUM_SOCKET );

 only leave the while when i have all socket accepted. no?

Oscar



On Tue, Sep 29, 2009 at 3:10 PM, Kieran Mansley <address@hidden> wrote:
On Tue, 2009-09-29 at 14:19 +0200, Oscar F wrote:

> how do i reset the fd struct?

Move the block of code that sets acceptset inside the while loop that
calls select().

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]