Hello, I'm trying to make a program that will list all tcp/udp connections. I can get the actuall connections using GetTcpTable, GetUdpTable but how can I get the process that is associated with that connection?
thank you
Hello, I'm trying to make a program that will list all tcp/udp connections. I can get the actuall connections using GetTcpTable, GetUdpTable but how can I get the process that is associated with that connection?
thank you
What OS?
Also, whats the point, netstat already does this?
If any part of my post is incorrect, please correct me.
This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.
windows xp, The reason I want to do this is I think it will be a usefull feature in my program.
Also, I did not ask how to get the connections, I asked how to get the process associated with that particular connection. I know this is possible because I have seen it done in other programs. 'active ports' for example.
I realise I named the topic wrong, sorry.
thanks
For windows the netstat option is -b to show what programs PID its associated with. As for how its implemented, I am unsure. I would bet their is a system call or something that gets information on what filedescriptors/sockets a program has open. I have no idea beyond that, all I can think of is to search through MSDN to see if they have any info on that posted. Ill let any one else with an idea post now.
If any part of my post is incorrect, please correct me.
This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.
I did manage to find something that does what I want, GetExtendedTcpTable, but it only works on xp sp2, and I want it to work on 98 - xp