Java Socket Address Get getSocketAddress(InetSocketAddress socket)

Here you can find the source of getSocketAddress(InetSocketAddress socket)

Description

get Socket Address

License

Apache License

Declaration

public static String getSocketAddress(InetSocketAddress socket) 

Method Source Code


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

import java.net.InetSocketAddress;

public class Main {
    public static String getSocketAddress(InetSocketAddress socket) {
        return getHostName(socket) + ":" + getPort(socket);
    }//from  w  w w.j a v a2  s .com

    public static String getHostName(InetSocketAddress socket) {
        return socket.getHostName();
    }

    public static String getPort(InetSocketAddress socket) {
        return socket.getPort() + "";
    }
}

Related

  1. getPort(InetSocketAddress socket)
  2. getPort(SocketAddress socketAddress)
  3. getRandomLoopbackInetSocketAddress(final int port)
  4. getRawAddress(InetSocketAddress inetSocketAddress)
  5. getSimpleIpport(SocketAddress remoteAddr)
  6. getSocketAddress(SocketAddress socketAddress)
  7. getSocketAddress(String hostHeader)
  8. getSocketAddressList(String list, int defaultPort)
  9. getSocketConnectString( InetSocketAddress socketAddress)