if (isClosed()) throw new SocketException("socket is closed");
  public void send(DatagramPacket p) throws IOException  {    // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api.    SecurityManager s = System.getSecurityManager();    if (s != null && !isConnected ())      {        InetAddress addr = p.getAddress();        if (addr.isMulticastAddress())          s.checkMulticast(addr);        else          s.checkConnect(addr.getHostAddress(), p.getPort());      }    if (isConnected ())      {        if (p.getAddress () != null && (remoteAddress != p.getAddress () ||                                        remotePort != p.getPort ()))          throw new IllegalArgumentException (            "DatagramPacket address does not match remote address" );      }	        // FIXME: if this is a subclass of MulticastSocket,    // use getTimeToLive for TTL val.    if (getChannel() != null        && !getChannel().isBlocking ())      throw new IllegalBlockingModeException ();    impl.send(p);  }