Here you can find the source of getCanonicalConnectionAddress(InetSocketAddress address)
public static String getCanonicalConnectionAddress(InetSocketAddress address)
//package com.java2s; import java.net.InetSocketAddress; public class Main { public static String getCanonicalConnectionAddress(InetSocketAddress address) { return "tcp://" + address.getAddress().getCanonicalHostName() + ":" + address.getPort(); }/*from www .j a v a2 s . c o m*/ }