Getting the WAN address for a local tcpObject connection
by Drew Parker · in Torque Game Engine · 10/25/2005 (12:03 pm) · 0 replies
Hi,
In script, I have a tcpObject callback like this:
and %address stores the address of the incoming connection. The problem I'm having is, when I run two instances of TGE on the same machine, and have one instance connect to the other via tcpObject, the %address var is the local address (127.0.0.1), and not the WAN address. This causes me some trouble down the line, because I pass this address to a seperate machine that DOES need the WAN address.
Is there an easy way to grab the WAN address for the local machine? I looked around in the code in the Torque networking classes and couldn't find it, though I may have missed it. I'm running on Mac as well, so I'm ultimately looking for a cross-platform function.
If I find out anything in the meantime, I'll post it here.
Thanks!
- Drew
In script, I have a tcpObject callback like this:
function tcpObject::onConnectRequest(%this, %address, %id)
and %address stores the address of the incoming connection. The problem I'm having is, when I run two instances of TGE on the same machine, and have one instance connect to the other via tcpObject, the %address var is the local address (127.0.0.1), and not the WAN address. This causes me some trouble down the line, because I pass this address to a seperate machine that DOES need the WAN address.
Is there an easy way to grab the WAN address for the local machine? I looked around in the code in the Torque networking classes and couldn't find it, though I may have missed it. I'm running on Mac as well, so I'm ultimately looking for a cross-platform function.
If I find out anything in the meantime, I'll post it here.
Thanks!
- Drew