Ethernet SMTP recover a Network loss..

Hi!

I am using an arduino Ethernet, which uses DHCP to get an address and then connects to a TCP socket server...

All is good!

The issue is that I poll the server every minute with a ping, when the server answers I get a pong... Wich is intended to find out if I have disconnected from the server....

If I timeout... I then go to the same routine I used to get an address from the DHCP server, and then connects to the server via TCP... I stay in an infinite loop with a delay of 10 seconds between connect tries...

The issue is that I can't get the reconnect to happen!.. Specially the DHCP part... If I unplug de Ethernet cable, the system timeout and goes to the reconnect routine... But stays there forever in the Ethernet.Begin(mac). For some reason it does not reconnects to the DHCP server.

Any clues if I have to reset something or do something differently?

I am thinking about a software reset, but I see that this is not recommended for some reason...

Any clues welcomed and appreciated!

Maybe I did not understand you correctly but why do you have to connect to the DHCP server again? You still have the IP, don't you? Just reconnect to the socket server and don't forget to free your used socket on the Arduino side else you'll run out of sockets fast.

If you post your code we might get an idea of what your trying to do and how you're doing it. Resetting your Arduino is almost certainly not the right way to solve your problem.