- There probably exist some UPnP standalone libraries out-there (you mentioned at least one). Can they be used easily with SFML at this point? I mean, since I know nothing of the protocol, can a UPnP setup be made independently of SFML sockets? Similarly, would a UPnP API in SFML impact sf::Socket*.
Yes, a library can be used independently afaik. I'm not really sure if it would interfere with sockets... miniupnp has a forum where you could ask, though.
- You said: "I don't want to use "hole-puching" to reach them since I don't have a server." How do you handle the discovery of peers from a given peer? Are there some server-less protocol for discovery of peers across the Internet?
I will give them my router's IP with the forwarded port, which will then give me their IP (even if they're behind a NAT) which I can then use to make a P2P connection (the forwarded port doesn't need to be used anymore and can be deleted).
Well, yeah, normally UDP works for P2P but the problem is that NAT boxes (routers with several devices under 1 IP) make you unreachable unless you contact the person you're trying to be reached by first.
- Are there some serious drawback, beside needing a server, to hole punching? Any other alternative we should know about too?
No, hole punching just consists in having a server that relays the IP to other clients. It has a scary name but is harmless.
Any port mapping/forwarding method works, and there's a few other workarounds I believe, but I don't know enough to talk about.
- UPnP seems to be a relatively big protocol. Don't we want something simpler in SFML, that would be more tailored to configuring NAT traversal and leave out many module of UPnP? Something like the Internet Gateway Device Protocol (which is use by UPnP I think), maybe?
Well, I don't know how big UPnP is, and I'm not sure if you have to integrate ALL of it into SFML to make it work.
All I need is "AddAnyPortMapping()" and maybe "DeletePortMapping()" and I'll be able to relay everyone's real NAT IP so that P2P connections can be made.