Here you can find the source of inetAddrToHoman(final InetSocketAddress sockAddr)
public static String inetAddrToHoman(final InetSocketAddress sockAddr)
//package com.java2s; //License from project: Apache License import java.net.InetSocketAddress; public class Main { public static String inetAddrToHoman(final InetSocketAddress sockAddr) { return sockAddr.getAddress().getHostAddress() + ":" + sockAddr.getPort(); }/*from w ww . ja va2s. c o m*/ }