WebSocketsPlugging Into The WebPaul FryerSoftware ArchitectFiserv
What is a WebSocket?Full-duplex bidirectional communication channel.A very low overhead TCP connection.Supported in HTML5 browsers.Cross Domain Capable.
Why WebSockets?Way more faster than Log Polling.Works with firewalls/proxies.Go from kilobytes of data to 2 bytes.Go from 150ms to 50ms latency.
Polling vs. WebSocketsImage Source: Kazzing.com
Polling vs. WebSocketsImage Source: WebSocket.org
Browser Support
Where is it used?Rich Internet Applications (RIA)Online Games (Farmville)Chat ApplicationsStreaming ApplicationsFinancial DataReal Time NewsReal Time AlertsAnalytics (chartbeat)
PusherPusher (pusher.com) is a hosted API for quickly, easily and securely adding scalable real-time functionality via WebSockets to web and mobile apps.Example Apps Built on Pusher:http://retrospectiveapp.heroku.comhttp://jzlabs.com/stuff/marblepaint
Client HandshakeGET /demo HTTP/1.1 Host: example.com Connection: Upgrade Sec-WebSocket-Key2: 12998 5 Y3 1 .P00 Sec-WebSocket-Protocol: sample Upgrade: WebSocketSec-WebSocket-Key1: 4 @1 46546xW%0l 1 5 Origin: http://example.com ^n:ds[4U
Server HandshakeHTTP/1.1 101 WebSocketProtocol Handshake Upgrade: WebSocketConnection: Upgrade Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Location: ws://example.com/demo Sec-WebSocket-Protocol: sample 8jKS'y:G*Co,Wxa-
The ConnectionData is sent in the form of UTF-8 text.Each frame of data starts with 0x00 byte.Each frame of data ends with 0xFF byte.UTF-8 text is in-between the start and ending bytes.
JavaScript APIonopen: When a socket has openedonmessage: When a message has been receivedonclose: When a socket has been closed
JavaScript APIvar socket = new WebSocket("ws://localhost:8000/ServiceEndpoint/");  socket.onopen = function(){  alert("Socket has been opened!");  socket.onmessage = function(msg){  alert(msg); //Awesome!  }  
Socket.ioSocket IO is a library that supports non WebSocket JS clients. It will leverage websockets if available, but fall back to other transports for earlier browsers.http://socket.io
Kaazing Enterprise Gateway
Building a WebSocket Server.Net web socket server:http://superwebsocket.codeplex.com/Easy to build your own web socket service on base classes.Comes with an example chat application.
Everyone Go Here:bit.ly/r2a459
Ideas for Financial IndustryMore responsive user interfaces.Financial DashboardsCorporateSmall BusinessEven PersonalReal time reporting.Connected Devices (real time location).

Web Sockets