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().