Hi, I was wondering if anyone could help me figure out how to see who is connected to you when you are hosting a game on a specific port via c++. I know you can use netstat in cmd prompt and it shows a bunch of info of who you are connected to and stuff.

What I want to do is make a program with C++/win32 api and winsock that detects people connecting to me and I would like to be able to ping to that IP or disconnect them.

Thanks for those that take the time to read this.

8 Years
Discussion Span
Last Post by lashatt2

For first you have to create socket. After that wait for connections. When connection is incoming, accept it and get data of connection(IP, port...) from the second argument of function accept. After that - type some function, which will send some test packets and awaits for the answer (some kind of ping), or use ShellExecute for using standard ping.

Something like that.


listen all I can connect and send messages at local but I can't connect in global. why? what should I do?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.