SecurityManager sm = System.getSecurityManager (); if (sm != null) sm.checkListen (impl.getLocalPort ());
Socket socket = new Socket();
  public Socket accept () throws IOException  {    if (impl == null)      throw new IOException ("Cannot initialize Socket implementation");    SecurityManager sm = System.getSecurityManager ();    if (sm != null)      sm.checkListen (impl.getLocalPort ());    Socket s = new Socket();    implAccept (s);    return s;  }