private void connectToAddress(InetAddress address, int port, int timeout) throws IOException { if (address.isAnyLocalAddress()) { doConnect(InetAddress.getLocalHost(), port, timeout); } else { doConnect(address, port, timeout); } }
/** * Binds the socket to the specified address of the specified local port. * * @param address the address * @param port the port */ protected synchronized void bind(InetAddress address, int lport) throws IOException { socketBind(address, lport); if (socket != null) socket.setBound(); if (serverSocket != null) serverSocket.setBound(); if (address.isAnyLocalAddress()) { anyLocalBoundAddr = address; } }