Non-Blocking Ethernet Library

The connect() and begin() functions aren't blocking either. The DHCP begin() call is "blocking" if you have a SD card in the slot and don't disable or initialize it. Then the Ethernet.begin(mac) call will never return.

Hmm... Correct if I am wrong but I believe begin() will block (at least for "timeout seconds") until it either gets an ip or if it fails.

In my case I need a resilient device, that can "run" other tasks while networking is being figured it out. Worst case scenario, the device is running and for some reason network needs to be re-established (after a power outage for instance) while other tasks are still running.

Does it make sense ?

1 Like