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: <40996669.B20E11C9@hot.pl> Date: Thu, 06 May 2004 00:10:49 +0200 From: Jacek Trzmiel MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: pthreads and sockets - Cannot register window class error References: Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Hi, > I can't replicate your problem, but I know where it is coming from, > basically standard windows winsock is not geared up to handle that man > socket connections. When a socket is made and then closed the socket > actually stays open for about 240-300 seconds depending on your > registry settings, this is so that winsock can make sure the > connection has been properly closed off. As Dave wrote - normal TCP behaviour. > what you are seeing is that basically as you run your program more and > more times, you are creating sockets in memory, every time the socket > is closed YOU think that the socket is cleaned up but its not, and so > you basically loose a bit of memory until the timeout for the socket > has occurred, i guess through debugging where you run and re-run your > test app you have run out of RAM so you see these errors. - Program failed with second run after reboot - netstat showed 140 sockets in TIME_WAIT state. - Program did run succesfully some tries later when netstat showed 484 sockets in TIME_WAIT state. > The only thing you can do is not make so many client socket connections Same error did happen with 20 connections. I would not describe it as many. > or use windows server which has a winsock geared for server like behavior, > or make the modifications mentioned in the article, or just simply use *bsd > or linux tcp/ip stack. Sure I can use other stack. But I prefer to find out exactly where and why error happens, so I can avoid it in the future. Best regards, Jacek. -- 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/