Use a timeout when trying to connect to the built in httpd instead of using sleep