I need to make some general way for my own peer-to-peer UDP or TCP communication between my own clients over internet, without creating own server.
I cannot just use XMPP for the communication because file transmit are necessary.
Do I understand the possible sequence of actions correctly?
- Connect to some (or any?) XMPP server, using prepared existing XMPP account
- Search for another my own client connected to XMPP and connect to it.
- Resolve an unique public global internet (IP?) address or ID for each client (how?)
- Exchange these addresses between clients
- Make direct connection possible by some actions with clients' NATs
- Connect clients directly p2p to each other using received unique addresses
- Disconnect from XMPP server
- Communicate via my own p2p connection
If the sequence is correctly, what specific actions do I need to do to resolve unique addresses, and to make an UDP or TCP connection then? How that can be done on c++?
Edit.
I've found nice answer here: Programming P2P application