I'm trying to find a way to communicate between two NAT-ed nodes using Java. My requirements pretty much align with the ICE-specification; i.e. I want to try STUN first and then fall back to relaying the data when nothing else works. I need some kind of streaming protocol, so either TCP must be supported or the library should provide some kind of streaming and error correction-abstraction on top of UDP (like libjingle does).The relaying must be decentralized, i.e. go through other nodes in the network and not through a central server.
Does anyone know any good implementations of this in Java?
Google's libjingle (http://code.google.com/apis/talk/libjingle/index.html) seem to provide pretty much what I'm looking for. Unfortunately it's written in C++. Do you think I should try that using JNI or are there any Java-clones of libjingle? I've briefly looked at Smack (http://www.igniterealtime.org/projects/smack/index.jsp) but I can't really find if it provides the features I'm looking for.