Poll for resource available with RequireJS

So I’m writing an app using RequireJS and Socket.io that checks to see if the socket.io resource is available and then, on connection, bootstraps the app. In case socket.io ever temporarily goes down I’d like to have requireJS poll for the resource a few times until it is available and then continue on initializing the application.