if (isClosed()) throw new SocketException("socket is closed");
  public void setTimeToLive(int ttl) throws IOException  {    if (ttl <= 0 || ttl > 255)      throw new IllegalArgumentException("Invalid ttl: " + ttl);    impl.setTimeToLive(ttl);  }