Does WiFi.connect() block the loop?

Wondering if the WiFi.connect() blocks the loop? I want to use my device when there is not wifi but automatically connect when I get into range of wifi.


some reading here that you may find useful

I currently use spark.connect but this is blocking I was wondering if I call wifi.connect would block the loop too if not I would call wifi connect wait for the connection them connect to the cloud

This would also answer some of your question

and from @BulldogLowell 's suggestion to this

Especially this part might be of interest for you

How much “blocking” are you prepared to accept?
Neither way will come without delay/blocking of your active code.

I also found that WiFi.connect() blocked, preventing loop() processing. In my case I had a button which when long pressed would turn power off and I discovered that when I lost the WiFi connection and attempted to connect, I could not turn off the power!

In my case I moved much of my non-network related tasks into a timer callback since timers continue to run fine when the loop is blocked in WiFi.connect(). I would suggest augmenting the documentation to indicate it’s a blocking call.