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]

RE: socket not closed in a threaded server


Sylvain Delhomme wrote on 25 September 2008 13:57:

>> The "associated udp" socket is an internal thing managed by winsock; it's
>> standard OS behaviour and happens to native win32 programs as well.
> 
> I've just ported my small app to Winsock and I did not see this.

  Hmm, odd, but it's a well known phenomenon.  Here's an example showing
solely the use of cmd.exe and iexplore.exe; Cygwin not involved at all except
for the diff command at the end.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\dk>netstat -ano > before.txt

C:\Documents and Settings\dk>"\Program Files\Internet Explorer\iexplore.exe"

C:\Documents and Settings\dk>netstat -ano > after.txt

C:\Documents and Settings\dk>diff -pu before.txt after.txt
--- before.txt  2008-09-25 14:28:39.829644300 +0100
+++ after.txt   2008-09-25 14:28:50.955000300 +0100
@@ -27,6 +27,7 @@ Active Connections
   UDP    127.0.0.1:1025         *:*                                    600
   UDP    127.0.0.1:1028         *:*                                    1108
   UDP    127.0.0.1:1056         *:*                                    1052
+  UDP    127.0.0.1:2301         *:*                                    2388
   UDP    127.0.0.1:2584         *:*                                    1580
   UDP    192.168.1.150:123      *:*                                    1580
   UDP    192.168.1.150:137      *:*                                    4

C:\Documents and Settings\dk>


  As you see, even when not showing a page (launching iexplore.exe =
about:blank on my machine), it has an open UDP socket.

  Sorry, I don't have a source right now; I'll keep looking.  I'm writing off
the top of my head, and I just remembered that possibly it's not even a
loopback connection, it may just be some artifact of windows netstat.  I'll
post again if I can find a reference.

 
>> It's
>> used for some kind of internal loopbacky rpc-ish thingy and you can
>> ignore it. 
>> 
> 
> Could you provide me more info about this because it can be quite
> annoying in a real application ?

  What kind of "annoying"?  It does no harm and requires no action on your
part TTBOMK.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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