The variable connectLoop controls the timeout. If the connection breaks, like hardware fail, it prevents the "while(client.connected()" loop from becoming an endless loop. I tested that by downloading a big webpage and pulling the CAT5 connector out of the shield halfway through the download. Then a couple minutes later, after several failed connection attempts, I plugged it back in, and it went right back to working.
edit: The "while(client.connected())" loop is exited when the server sends a close message, but not a hardware fail. If the connection breaks, the close message never gets through to the client from the server, and the client code hangs in that loop.
The connectLoop counts the iterations of that loop with no packet received. With the delay(1) in the loop, it is about a millisecond through each iteration, so I used 10000 as the number of times through the loop without a packet to exit the loop with the "client.stop()" call (no packet for 10 seconds). The other comparison loops exit normally, and the last client.stop() does nothing but return if the connection is closed.