Here you can find the source of extractClientAddress(SocketAddress remoteAddress)
public static String extractClientAddress(SocketAddress remoteAddress)
//package com.java2s; //License from project: Apache License import java.net.InetSocketAddress; import java.net.SocketAddress; public class Main { public static String extractClientAddress(SocketAddress remoteAddress) { String clientAddress;/*from ww w .j ava2 s .c o m*/ if (remoteAddress instanceof InetSocketAddress) { clientAddress = ((InetSocketAddress) remoteAddress).getHostName(); } else { clientAddress = remoteAddress.toString(); } return clientAddress; } }