Thanks for the reply. It does indeed reconnect if you unplug it, but only when it's unplugged between requests.
The problem I have is that the code hangs if you unplug the ethernet when it is in the "while" loop and reading the client. Any thoughts on how to avoid this? I need the code to be robust enough that if it loses internet connection, it can pick up where it left off or start over when it reconnects. Thanks.