if (isClosed()) throw new SocketException("socket is closed");
  public boolean getKeepAlive () throws SocketException  {    Object buf = getImpl().getOption(SocketOptions.SO_KEEPALIVE);    if (buf instanceof Boolean)      return(((Boolean)buf).booleanValue());    else      throw new SocketException("Internal Error: Unexpected type");  }