if (getImpl() != null) getImpl().close();
if (isClosed()) throw new SocketException("socket is closed");  getImpl().close();
  public synchronized void close ()  throws IOException  {    if (getImpl() != null)      getImpl().close();    if (getChannel() != null)      getChannel().close();        closed = true;  }