/** * Returns the address of the endpoint this socket is bound to. * * @return a {@code SocketAddress} representing the local endpoint of this * socket, or {@code null} if it is closed or not bound. * A non-null return value is always of type {@link UnixSocketAddress} * @see #bind(SocketAddress) */ @Override public SocketAddress getLocalSocketAddress() { if (isClosed()) { return null; } if (null == chan) { return null; } return chan.getLocalSocketAddress(); }