public String toString() { InetSocketAddress local=null, remote=null; try {local=channel != null? (InetSocketAddress)channel.getLocalAddress() : null;} catch(Throwable t) {} try {remote=channel != null? (InetSocketAddress)channel.getRemoteAddress() : null;} catch(Throwable t) {} String loc=local == null ? "n/a" : local.getHostString() + ":" + local.getPort(), rem=remote == null? "n/a" : remote.getHostString() + ":" + remote.getPort(); return String.format("<%s --> %s> (%d secs old) [%s] [recv_buf: %d, reader=%b]", loc, rem, TimeUnit.SECONDS.convert(getTimestamp() - last_access, TimeUnit.NANOSECONDS), status(), recv_buf.get(1) != null? recv_buf.get(1).capacity() : 0, readerRunning()); }
public String toString() { InetSocketAddress local=null, remote=null; try {local=channel != null? (InetSocketAddress)channel.getLocalAddress() : null;} catch(Throwable t) {} try {remote=channel != null? (InetSocketAddress)channel.getRemoteAddress() : null;} catch(Throwable t) {} String loc=local == null ? "n/a" : local.getHostString() + ":" + local.getPort(), rem=remote == null? "n/a" : remote.getHostString() + ":" + remote.getPort(); return String.format("<%s --> %s> (%d secs old) [%s] [recv_buf: %d, reader=%b]", loc, rem, TimeUnit.SECONDS.convert(getTimestamp() - last_access, TimeUnit.NANOSECONDS), status(), recv_buf.get(1) != null? recv_buf.get(1).capacity() : 0, readerRunning()); }