How can I get a list of open TCP conections, similar to the output of netstat -a? I've been digging through the winsock documentation with no luck.
Printable View
How can I get a list of open TCP conections, similar to the output of netstat -a? I've been digging through the winsock documentation with no luck.
This is a lot more than you think.
Attached is Mark Russinovich's freeware code for netstatp which does whay you want.
Perfect! If only my gf wasn't beta testing Sims Online, I'd be able to check it out more....
Ok, one last question on this subject. Where would I look to find out what application/process is responsible for the port? This seems to be highly guarded information :)
You mean which program is *actually* using the port, or what program has been allocated that port on the list? This is my /etc/services file:
I'm going to have to say what program is actually using it. I'd like to narrow it down to an .exe actually.. Like alot of firewalls do, I just want to know what's open and 'who' is responsible. the GetTcpTable() function in the iphlpapi.dll is really usefull, but I just wanted the extra step. Under XP it's possible through the same DLL, but I use mostly 2k..