String address = NetworkUtils.getLocalAddress(InetAddress.getByName(remoteControlChannel.getHost())).getHostAddress(); int localPort = serverSocket.getLocalPort();
throws SocketException InetAddress localAddress = getLocalAddress(expectedSource, getProtocolFamily(expectedSource)); if (localAddress == null) { if (!FAKED_ADDRESSES.isEmpty()) {
public HostPortList setStripedPassive(PortRange range, int queue) throws IOException { // remove existing sockets, if any socketPool.flush(); if (serverSocket == null) { ServerSocketChannel channel = ServerSocketChannel.open(); range.bind(channel.socket(), queue); serverSocket = channel.socket(); } gSession.serverMode = GridFTPSession.SERVER_EPAS; gSession.serverAddressList = new HostPortList(); String address = NetworkUtils.getLocalAddress(InetAddress.getByName(remoteControlChannel.getHost())).getHostAddress(); int localPort = serverSocket.getLocalPort(); HostPort hp = null; if (remoteControlChannel.isIPv6()) { String version = HostPort6.getIPAddressVersion(address); hp = new HostPort6(version, address, localPort); } else { hp = new HostPort(address, localPort); } gSession.serverAddressList.add(hp); logger.debug("started single striped passive server at port {}", gSession.serverAddressList.get(0).getPort()); return gSession.serverAddressList; }