code: public void run() {
      /**
       * Ensure we start fresh.
       */
      closeServerSocket();
      closeAllAcceptedSockets();
  
      // start the server socket
      try {
        serverSocket = new ServerSocket(port);
      } catch (Exception e) {
        getLogger().error(
          "error starting SocketReceiver (" + this.getName()
          + "), receiver did not start", e);
        active = false;
  
        return;
      }
  
      Socket socket = null;
  
      try {
        getLogger().debug("in run-about to enter while not interrupted loop");
  
        active = true;
  
        while (!rThread.isInterrupted()) {
          // if we have a socket, start watching it
          if (socket != null) {
            getLogger().debug(
                    "socket not null - creating and starting socketnode");
            socketList.add(socket);
  
            SocketNode13 node = new SocketNode13(socket, this);
            synchronized (listenerList) {
              for (Iterator iter = listenerList.iterator();
                   iter.hasNext();) {
                  SocketNodeEventListener l =
                          (SocketNodeEventListener) iter.next();
                  node.addSocketNodeEventListener(l);
              }
            }
            socketMap.put(socket, node);
            new Thread(node).start();
            socket = null;
          }
  
          getLogger().debug("waiting to accept socket");
  
          // wait for a socket to open, then loop to start it
          socket = serverSocket.accept();
          getLogger().debug("accepted socket");
        }
      } catch (Exception e) {
        getLogger().warn(
          "exception while watching socket server in SocketReceiver ("
          + this.getName() + "), stopping");
      }
  
      getLogger().debug("{} has exited the not interrupted loop", getName());
  
      // socket not watched because we a no longer running
      // so close it now.
      if (socket != null) {
        try {
          socket.close();
        } catch (IOException e1) {
          getLogger().warn("socket exception caught - socket closed");
        }
      }
  
      getLogger().debug("{} is exiting main run loop", getName());
    }
docs: Loop, accepting new socket connections.