From 3c2c86da60398dfd3a2952f8cf35f3ab559cdf96 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 28 May 2010 23:12:17 +0000 Subject: [PATCH] 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 --- .../com/threerings/presents/client/BlockingCommunicator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/presents/client/BlockingCommunicator.java b/src/java/com/threerings/presents/client/BlockingCommunicator.java index 6ece46408..d37fbc5ca 100644 --- a/src/java/com/threerings/presents/client/BlockingCommunicator.java +++ b/src/java/com/threerings/presents/client/BlockingCommunicator.java @@ -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));