if (isClosed()) throw new SocketException("socket is closed");
  public int getTrafficClass () throws SocketException  {    Object obj = getImpl().getOption(SocketOptions.IP_TOS);    if (obj instanceof Integer)      return ((Integer) obj).intValue ();    else      throw new SocketException ("Unexpected type");  }