Showing results for 
Search instead for 
Did you mean: 

What do Windows TCP Active/Passive Connections statistics really indicate?

In the process of testing some LabVIEW code that uses TCP/IP for communication I'm using the Windows IP Helper API function GetTcpStatistics() to display TCP information.  The same stats can be displayed by executing the command 'netstat -s' in a command window. 
Two of the values that are displayed are Active Opens and Passive Opens.  What has me puzzled is that I've only observed these values increasing.  Running the attached simple TCP/IP client/server VIs will cause these values to increase.  Why don't they decrease after the connections are closed?  A third value available, Current Connections, increases and decreases.  I've tried searching the Microsoft site but there is only a brief description of these values that only really tells you one is a server listening and one is a client.  My guess is these values just indicate the number of times an active or passive connection has been opened, and indicate nothing about current connections, but I've been unable to confirm this.  I'd like to rule out this being something to be concerned about (i.e. like a memory leak).
Download All
0 Kudos
Message 1 of 5
Both of your VIs do not contain any loop, so every time you start them, they will create a new connection and finish.
How are you running these? Are you possibly using the "continuous run" button? That does not sound like such a good idea because it would simply restart the VI whenever it finishes. This is more of a debugging feature than anything else and should not be used for normal operation.
Have a look at the simple server and client examples that ship with LabVIEW. It should get you pointed in the right direction. Good luck! 🙂
0 Kudos
Message 2 of 5
Sorry, I should have been more specific in my original posting.  The simple VIs attached have nothing to do with my application.  They were just something quick I whipped up to be able to set a breakpoint at various places (after opening the connection but before closing it) in an effort to better understand the TCP statistics.
0 Kudos
Message 3 of 5

I can not confirm based on any official documentation or anything, but I can tell you that I too have only ever seen those numbers increase and don't reset until a reboot.  It would be nice if Microsoft had some actual documentation on netstat, but alas. 


And for what it's worth, on my server, which is very busy, I saw my "Active opens" value at well over 5 million just before I last rebooted it.  It seems unlikely (ie. impossible) that there are actually 5 million ports open so therefore it must be a cumulative value.

0 Kudos
Message 4 of 5

They are simply counters. Every time a connection is opened if increases Windows has many such counters..

Rolf Kalbermatter
DEMO, TU Delft
My Blog
0 Kudos
Message 5 of 5