Here you can find the source of getSimpleIpport(SocketAddress remoteAddr)
private static String getSimpleIpport(SocketAddress remoteAddr)
//package com.java2s; //License from project: Apache License import java.net.InetSocketAddress; import java.net.SocketAddress; public class Main { private static String getSimpleIpport(SocketAddress remoteAddr) { if (remoteAddr == null) { return null; }/*from ww w .j av a 2 s .c om*/ if (remoteAddr instanceof InetSocketAddress) { InetSocketAddress addr = (InetSocketAddress) remoteAddr; return String.format("%s:%d", addr.getHostString(), addr.getPort()); } return remoteAddr.toString(); } }