Re: netstat shows LISTENING on my client-side socket as well as ESTABLISHED?!

From: Tom Stewart (tastewar_at_msdn.microsoft.com)
Date: 03/16/04


Date: Mon, 15 Mar 2004 22:11:38 -0500

Hi Rhett-

I appreciate your taking the time to respond. And I appreciate your
explaining why things are as they are. However, if everything is working "as
designed" then I'd have to suggest that (ahem) the design is flawed. Or
perhaps I am missing something. Can someone tell me what *user* of NETSTAT
finds this listing of LISTENING "address objects" to be of value? to someone
attempting to understand what the software running on their box is doing
(which I think is the audience NETSTAT is trying to serve), a LISTENING
address implies one that can be connected to. I just don't understand how an
implementation artifact (this "TDI address object" you mention) would be of
interest to anyone except the guy who invented the concept. ("See, here's
where you can see the second TDI A.O. I create -- right here in the NETSTAT
output. Isn't that cool!!")

I am a programmer, too, been one for many years now, but one of my pet
peeves is when developers explain the way things are as if it is sufficient
justification for behavior that any rational user would find incorrect. I
run into it all the time in my company when programmers take "code elegance"
as the be-all/end-all measure of the value of the code.

And I also have to disagree with you about the side effects. It cost me half
a day of trying to track down where I was creating a listening socket. And
judging from other nntp postings, I'm not the only one. Think about how many
people have wondered what the heck those listening ports were vs. the number
of people (exactly one, me thinks) who find the inclusion of this artifact
valuable. Think for a minute -- if it's always there, what value is there in
listing it?

/rant

Thanks for listening. If indeed you made it this far. And as you might
expect, I've been unable to repro my colleague's success in connecting to
this port.. ;-)

--
Tom
"Rhett Gong [MSFT]" <v-raygon@online.microsoft.com> wrote in message
news:S$%23XbpvCEHA.660@cpmsftngxa06.phx.gbl...
> Hi Tom,
> From your description, you would like to know why netstat.exe reports the
LISTENING state for a client socket.
>
> Netstat.exe does not report on sockets, it reports on opened TDI address
objects. Every time we make a socket client connection, it creates 2 entries
in the
> "netstat" output. Both these entries have the same source port number; one
is set as ESTABLISHED while the other is set as LISTENING. So what you are
seeing is
> correct and this is by design as far as I can tell. From my test, this
does not have any side effects.
>
> >When I tried, I was unable to connect to it, but the guy checking
> >out the code says he *was* able to.
> I get the same answer as you have. Could you let him post his code in this
thread? We are all interested in how he made it happen. :-)
>
> Have a nice day!
> Rhett Gong [MSFT]
> Microsoft Online Partner Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Please reply to newsgroups only. Thanks.
>


Relevant Pages

  • Re: Socket connection issue
    ... It opens a socket connection to a process ... I copied the scripts over to another computer that's running IIS/PHP ... is not listening. ... Use netstat to see if your end point is listening on address 127.0.0.1, ...
    (comp.lang.php)
  • Re: Socket connection issue
    ... It opens a socket connection to a process ... I copied the scripts over to another computer that's running IIS/PHP ... is not listening. ... Use netstat to see if your end point is listening on address 127.0.0.1, ...
    (comp.lang.php)
  • Re: Socket connection issue
    ... It opens a socket connection to a process ... I copied the scripts over to another computer that's running IIS/PHP ... It is normal that a process cannot connect to a port which is not listening. ... Use netstat to see if your end point is listening on address 127.0.0.1, for instance using: ...
    (comp.lang.php)
  • Re: daemon MTA-IPv4: Problem creating SMTP socket?
    ... daemon MTA-IPv4: server SMTP socket wedged: exiting ... but it sounds like something else is using / listening on ... Try doing a netstat to see if something else is using the socket. ...
    (comp.mail.sendmail)
  • Re: So, heres the (hopefully) next topic of debate
    ... > deliberately made him think out the solutions to the design problems he ... > Its proved a success,as now he is able to tackle any problem scenario ... feet to the masters and learn by listening - and paying attention (that ...
    (rec.crafts.jewelry)