Use the InetAddress obtained for the TCP socket for the datagram

channel as well, instead of re-resolving the hostname.  This is because
we plan to use round-robin resolution for the game server, and I don't
want to chance getting different IPs for TCP and UDP.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6069 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2010-05-28 23:12:17 +00:00
parent f7a828e0c4
commit 3c2c86da60
@@ -818,7 +818,8 @@ public class BlockingCommunicator extends Communicator
protected boolean connect (int port)
throws IOException
{
_datagramChannel.connect(new InetSocketAddress(_client.getHostname(), port));
_datagramChannel.connect(new InetSocketAddress(
_channel.socket().getInetAddress(), port));
for (int ii = 0; ii < DATAGRAM_ATTEMPTS_PER_PORT; ii++) {
// send a ping datagram
sendDatagram(new PingRequest(Transport.UNRELIABLE_UNORDERED));