I am looking into P2P, without using server(to start with); I want to use UDP for clients talk to e开发者_StackOverflowach other, without writing a server. For instance, to start with I'd provide the connecting IP/Port manually to the connecting peers.
Is is possible to use UDP with Teredo(ipv6) transient protocol?
Any links/pointers/etc much appreciated.
If your peers have private IPv4 addresses, you will need some kind of server which will tell them how it has been translated by their NATs. You will need to send this translated address to other peers and wait for incoming traffic.
There is no way you can escape the need of a server with private IPv4 addresses. You can't use 'getLocalHost()', because it is only valid on the LAN.
If all your peers have public ipv4 addresses, then you can use these as is (no need for Teredo, etc...). If your peers all use IPv6, then you can also use their addresses as is.
If you have a mix of ipv4 and ipv6 and if you want to use Toredo to bridge both traffic, then you'll have to have some kind of central server peer act as a bridge. In this case, you can't escape the server too.
精彩评论