ping server port + loop to wait for the server to settle