if (impl == null) throw new SocketException ("Cannot initialize Socket implementation");
if (isClosed()) throw new SocketException("socket is closed");
  public void setTrafficClass(int tc)    throws SocketException  {    if (impl == null)      throw new SocketException ("Cannot initialize Socket implementation");    if (tc < 0 || tc > 255)      throw new IllegalArgumentException();    impl.setOption (SocketOptions.IP_TOS, new Integer (tc));  }