DatagramChannel NAT traversal

Started by elias4444, March 23, 2006, 18:16:41

Previous topic - Next topic

elias4444

I've asked similar things like this before, but I'm having a really hard time finding information on this one. I'm trying to figure out how to handle NATs when using UDP (datagramchannel) networking. I can send a packet to a server, but when the server sends a response back to InetSocketAddress from which it received the packet, the client NAT never lets it through. I've found a few NATs that do work, but just as many that don't. Is there a trick to this?

P.S. TCP works fine (since it's a server/client connected channel), but I really must use UDP (as it's a fast-paced action game).
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Betalord

Do you assign your packet's destination port to the source port of the previous received packet?

Edit: ah sorry didn't notice this way posted a year ago