delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/05/18:11:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <sc0rp AT hot DOT pl>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: pthreads and sockets - Cannot register window class error
References: <BAY9-F6gmkLGeq3v7dq00002682 AT hotmail DOT com>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019