code: public Socket accept() throws IOException {
          if (isClosed())
              throw new SocketException("Socket is closed");
          if (!isBound())
              throw new SocketException("Socket is not bound yet");
          Socket s = new Socket((SocketImpl) null);
          implAccept(s);
          return s;
      }
docs: Listens for a connection to be made to this socket and accepts
  it. The method blocks until a connection is made.
  
  <p>A new Socket <code>s</code> is created and, if there
  is a security manager,
  the security manager's <code>checkAccept</code> method is called
  with <code>s.getInetAddress().getHostAddress()</code> and
  <code>s.getPort()</code>
  as its arguments to ensure the operation is allowed.
  This could result in a SecurityException.
  
  @exception  IOException  if an I/O error occurs when waiting for a
  connection.
  @exception  SecurityException  if a security manager exists and its
  <code>checkAccept</code> method doesn't allow the operation.
  @exception  SocketTimeoutException if a timeout was previously set with setSoTimeout and
  the timeout has been reached.
  @exception  java.nio.channels.IllegalBlockingModeException
  if this socket has an associated channel, the channel is in
  non-blocking mode, and there is no connection ready to be
  accepted
  
  @return the new Socket
  @see SecurityManager#checkAccept
  @revised 1.4
  @spec JSR-51