I am writing a client app which connects to a server process through a Unix domain socket. If the server process is not running, I want the client to wait until the server has started and is listening for connections on the socket.
Currently I have a retry loop in the client which calls connect() every second until it successfully connects to the socket.
Is there any function I can call which will simply block until a particular named socket (e.g. "/var/mysock") is created and bound to a server process?