Dojo

Using socket.io in Dojo

I have a requirement to check to see if a group of servers is reachable/available. Right now I’m using fsockopen in a PHP script, and using request.post to call it. When I run the script by itself, it works. However, if I run it from my application using Deferred, it runs right through the script really fast and sets all machines to down. It’s almost as if the process is ignoring the Deferred/Promise implementation.

So, I was looking at other options and came across is-reachable from node.js or socket.io. Does anyone know if those can be integrated into, or use along side of, Dojo? I am using Dojo 1.11.2 at the moment.

Thanks,
Harry

Hi Harry, there’s no reason they cannot be. There is dojox/socket which was an early client-side implementation of a websocket client, so that may give you some ideas for how to integrate that within Dojo. We also covered WebSockets briefly in our Dojo 202 workshop which I believe you attended if I recall correctly, so it may be worthwhile to look back at those examples.