LWJGL Forum

Programming => General Java Game Development => Topic started by: elias4444 on March 23, 2006, 18:16:41

Title: DatagramChannel NAT traversal
Post by: elias4444 on March 23, 2006, 18:16:41
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).
Title: Re: DatagramChannel NAT traversal
Post by: Betalord on March 10, 2007, 17:44:55
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