Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <4a03a72c050914161345feff39@mail.gmail.com> Date: Thu, 15 Sep 2005 01:13:04 +0200 From: znort Reply-To: znort AT delorie DOT com To: cygwin AT cygwin DOT com Subject: help on socket connexion Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j8ENDH0P026301 Hello everybody, Could U help me please it's very important of course :( I'm doing (trying exactly) a little client/serveur tcp programm. the skeleton is classic (from server side) main() { fd_set readfds, rmask; struct timeval tv; int sd; ... sd = create_socket(); ... while(1) { FD_ZERO(&rmask); FD_SET(sd, &rmask); readfds = rmask; tv.tv_sec=5; tv.tv_usec=0; if ( select(FD_SETSIZE, &readfds, NULL, NULL, &tv) ) { if (errno!=EINTR) { /* socket gets something ! */ if (FD_ISSET(sd ,&readfds)) { // goto child fork(); ... } } } Everything works except the famous FD_SETSIZE (yes I use select()) limit to 64 Now If I run a sample client test with a loop which try to connect 64 times to my server, it works... but with FD_SETSIZE limit, my server will hang after 64 fork. Right, but now, always on client side : If I try a loop with 32 connection, it's ok. then I stop all my clients connexion - the children on server side die (ok) If I try to connect again 32 times with my client by running my test program again... I meet again the FD_SETSIZE limit !!! I suppose I've forgotten something on server side but where ??? please help me -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/