What is the best way to check if client has an open port, and if it's forwarded properly?
The app works like this currently:
- Client creates a socket for incoming connections and wants to notify everyone about his open port. Client also tries to setup port forwarding using UPnP (but it's not always present and enabled).
- Client then sends his port to the "central" known server.
- Server should check if the port is open (forwarded properly) and return its status.
- If there is a forwarding problem, client will notify user.
The goal is to have an the IP + port info saved on the server to be able to give it to other clients. I could try to open a Socket
from server to client and see if it fails, but is there an easier (faster) way to do it?
For example, this site does something like that: http://www.canyouseeme.org/