This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Listening sockets not always closing?


Hello,
I'm running cygwin 1.5.18 on a number of versions of Windows, and I may
have found a problem closing sockets. I'm seeing this problem on Windows
2000 (no SP) and Windows 2000 SP1, but not on Windows 2000 SP2, SP3 or
SP4, and Windows XP and XP SP2 are also unaffected.

I created a small test program to illustrate this. Basically, in a loop, I
create a SOCK_STREAM socket, call bind() and then listen(), check the
output of netstat, and then close the socket. It works on several
versions of Linux, and Windows >= 2000 SP 2, but bind fails with
EADDRINUSE the second time through the loop on Windows <= 2000 SP1.

I think this is a cygwin-specific problem because if I try the same thing
with a native windows application using winsock, it works. (I can mail out
this code if anyone wants)

The code for my test program is attached. If I'm doing something stupid
here, I apologize for wasting everyone's time.

Attachment: tst-close.c
Description: Text document

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]