Code example for InetSocketAddress

Methods: getHostNamegetPort

0
    @Override 
    public void messageReceived(IoSession session, Object message) throws Exception {
        super.messageReceived(session, message);
        SocketAddress sa = session.getLocalAddress();
        InetSocketAddress isa = (InetSocketAddress) sa;
        log.debug(isa.getHostName() + ":" + String.valueOf(isa.getPort()) + "received:" + message);
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE