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:
@@ -818,7 +818,8 @@ public class BlockingCommunicator extends Communicator
|
|||||||
protected boolean connect (int port)
|
protected boolean connect (int port)
|
||||||
throws IOException
|
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++) {
|
for (int ii = 0; ii < DATAGRAM_ATTEMPTS_PER_PORT; ii++) {
|
||||||
// send a ping datagram
|
// send a ping datagram
|
||||||
sendDatagram(new PingRequest(Transport.UNRELIABLE_UNORDERED));
|
sendDatagram(new PingRequest(Transport.UNRELIABLE_UNORDERED));
|
||||||
|
|||||||
Reference in New Issue
Block a user