Socket IO

Posted on March 9, 2012

0


Socket IO is built on HTML5 websocket technology to allow real time cross platform applications (ie applications to run in any browser). Socket IO is designed to reduce latency between client and server. The socket.io documentation is available online at: http://socket.io/.

A useful article on Websockets and Socket.IO is available online at: http://howtonode.org/websockets-socketio.
For the Agricultural Network Project, Socket.IO was installed on top of NodeJs to allow communication between FrontlineSMS and a webpage.

To install Socket.IO in Mac OSX Snow Leopard, type the following command in the terminal:

$ npm install socket.io

To install Socket.IO client, type the following command in the terminal:

$ npm install socket.io-client

The next step would be to save the example server (available at: http://socket.io/) as serve.js using a text editor such as Textmate or J-edit.

The server can then be started in the terminal by navigating to the url and typing in the command:

$ node server.js

If there are any error messages thrown you can try moving the socket.io folder into the nodes_modules folder.

Screenshot shows the socket.io server invoked and running:

Also see post on Websockets: https://agnetpro.wordpress.com/2012/02/21/websocket/ and post on NodeJs: https://agnetpro.wordpress.com/2012/03/09/nodejs/.

 

16-04-2012

Socket io how o use – http://socket.io/#how-to-use

Advertisements