code: public synchronized void flush() throws IOException {
  
          Enumeration keys = allSockets.keys();
          // close all sockets before removing them
          while (keys.hasMoreElements()) {
              SocketBox myBox = (SocketBox) keys.nextElement();
              if (myBox != null) {
                  myBox.setSocket(null);
              }
          }
  
          allSockets.clear();
          freeSockets.clear();
          busySockets.clear();
      }
docs: Forcibly close all sockets, and remove them from the pool.