You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • @user49225, are you thinking about something that would use the push/pull over http protocol, such as the CometD / Bayeux Protocol? See http://en.wikipedia.org/wiki/Comet_(programming) and http://svn.cometd.org/trunk/bayeux/bayeux.html.

    That would be a really cool thing!... sending JSON objects around between Espruino nodes.

    To apply it with Espruino as an http server, Espruino's http server implementation would need to support NIO - non-blocking IO (and multiple concurrent connections), and as a client, it would need to support multiple concurrent connections. Furthermore, the XMLHTTPRequest object - or Web Sockets - would need to be supported... Most modern Web Application servers support CometD/NIO - and Web Sockets. At that time - about 5+ years ago - I used the XMLHttpRequest long polling as implementation technique. For the server I used jetty:// (see http://www.eclipse.org/jetty/ and for clients any devices with http connecting browsers. On jetty:// server I ran a small java servlet which implemented access control (like a registering process) and and routing (forward publishing) written in Java, and on the browser enabled devices, I used - of course - JavaScript for the application (sometimes running in a 'hijacked' embedded browser for Apple iPhone iOS and Android Phone, and 'XUL' modified/hijacked FireFox on laptop/desktop). Today, for (non-Espruino) server, something like node.js could be used to stay within JavaScript language domain, and Web Sockets for simpler, more direct http implementation.

About

Avatar for allObjects @allObjects started