I have a program that auto starts on a headless Raspberry Pi and so far I have built in a 10 second wait before it actually starts running. Sometimes my WiFi takes a bit longer than expected to establish a connection with my AP.
Even the 10 second waiting time also appears to occasionally not be long enough, for what ever reason. IMO it's bad programming so:
What is the correct procedure to wait for a network interface to be ready before attempting to bind to a socket?
Thanks in advance