each operator as an app, and the switchboard as a set of sockets. • They wait for codes, with messages attached • These come from either clients or servers • Using the code, they send the message on to the proper place
Provides a shim for sockets • Meaning you can use it with non- html5 browsers. • It does, however, work best on html5 browsers • Node Side • Provides a nice library for socket communication • Easy to use/simple API • API is similar to client side
your application is necessary: • ...in IE6 or other older browsers • ...in other situations where WebSockets API may not be supported, or when using WebSockets alone is not a solid plan. • Even when WebSockets are being supported, socket.io adds some functionality to your app. • When you want cross-domain communication on any browser
• Features such as heartbeats, timeouts, and disconnection support • These are not in the WebSockets API natively • Polyfills when the WebSocket API is not accessible or supported
4+, FF 3+ and most mobile browsers • When the client-side library can’t get to web sockets, it moves to things like Flash sockets, AJAX long polling, and JSONP polling, without affecting the API • Meaning you can go about your day without having to worry about supporting several types of communication!
a color, start drawing rectangles, and they will show up in all users’ browsers. • URL: http://multiboard.kperch.c9.io • Code: https://github.com/kperch/multi_canvas
• Send() data is treated as a ‘message’ event, emit () data is treated as arguments for a specific event emitter. • .set() and .get() store and retrieve session- relevant data. • .volatile.emit() - it’s ok if the message doesn’t get there (twitter feeds, etc)
.emit or .send call sends the message to all sockets except the one that initiated the broadcast • You can pass a callback to any .send or .emit call as the last parameter for acknowledgements, etc.