I was wondering... on a Windows box, how could you, in C++ detect what that box was connected to. For example, the netstat command. That lists all the computer's current connections. How would I read all the current connections into my program? I mean, I guess I could query netstat and parse through that but that seems awful inefficient and excessive. I'm looking to make a program, that when it detects a connection to a certain IP address, it closes this connection. Any help would be appreciated.
Have a look at GetTcpTable and maybe GetUdpTable.
Why thank you! This looks just like what I need. Thanks.