how to auto reconnect client and retry if disconnected ethernet module (w5100)

Instead of your

while (true);

reconnect as you do in the setup().