Java Socket Address Get getAddress(SocketAddress address)

Here you can find the source of getAddress(SocketAddress address)

Description

get Address

License

Apache License

Declaration

public static String getAddress(SocketAddress address) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.*;

public class Main {

    public static String getAddress(SocketAddress address) {
        if (address == null) {
            return null;
        }/* w  w w . j a v  a  2s .com*/
        if (address instanceof InetSocketAddress) {
            InetSocketAddress isa = (InetSocketAddress) address;
            return isa.getAddress().getHostAddress() + ":" + isa.getPort();
        } else {
            return address.toString();
        }
    }
}

Related

  1. get2428Address(InetSocketAddress address)
  2. get2428InetSocketAddress(String arg)
  3. get_IP_from_SocketAddress(String addr)
  4. getAddress(InetSocketAddress address)
  5. getAddress(InetSocketAddress address)
  6. getAddress(SocketAddress address)
  7. getAddressFirst(InetSocketAddress inetSocketAddress)
  8. getAddressRepresentation(final SocketAddress address)
  9. getAddrString(final SocketAddress address)