WebSockets represent a long-awaited evolution in client/server web technology. They allow a long-established single TCP socket connection to be established between the client and server, allowing bi-directional, full-duplex messages to be distributed instantly with little overhead, resulting in a very low latency connection.
Both the WebSocket API and the well as native WebSocket support in browsers such as Google Chrome, Firefox, Opera and a prototype Silverlight to JavaScript bridge implementation for Internet Explorer, there are now WebSocket library implementations in Objective-C, .NET, Ruby, Java, node.js, ActionScript and many other languages.
The Internet wasn't designed to be so dynamic. It was designed to be a collection of HyperText Markup Language (HTML) pages, linked together to form a conceptual web of information. Over time, static resources increased in number and richer elements such as images became part of the web fabric. Server technologies evolved to allow dynamic server pages - pages whose content is generated in response to a request.
Soon the need for more dynamic web pages led to the availability of Dynamic HyperText Markup Language (DHTML), all thanks to JavaScript (let's pretend VBScript never existed). In the years that followed, we saw cross-frame communication in an attempt to avoid page reloads, followed by in-frame HTTP polling. Things started to get interesting with the introduction of LiveConnect, then the forever frame technique, and finally, thanks to Microsoft, we ended up with the XMLHttpRequest object and thus Asynchronous JavaScript and XML (AJAX). AJAX in turn enabled XHR Long-Polling and XHR Streaming. But none of these provided a truly standardised, cross-browser solution for real-time, bi-directional communication between a server and a client.
Finally, WebSockets are a standard for bi-directional, real-time communication between servers and clients. Initially in web browsers, but ultimately between any server and any client. The standards-first approach means that we as developers can finally create functionality that works consistently across multiple platforms. Connection limitations are no longer an issue as WebSockets represent a single TCP socket connection. Cross-domain communication has been considered from day one and is handled within the connection handshake. This means that services like Pusher can easily use them to provide a massively scalable real-time platform that can be used by any website, web, desktop or mobile application.
WebSockets don't make AJAX obsolete, but they do replace Comet (HTTP Long-polling/HTTP Streaming) as the solution of choice for true real-time functionality. AJAX should still be used for short-lived web service calls, and when we eventually see a good uptake in CORS supporting web services, it will become even more useful. WebSockets should now be the standard for real-time functionality, as they provide low-latency, bi-directional communication over a single connection. Even if a web browser doesn't natively support the WebSocket object, there are polyfill fallback options that almost guarantee that any web browser can actually make a WebSocket connection.
sgcWebSockets is a complete package providing access to WebSockets protocol, allowing to create WebSockets Servers and Clients for .NET Applications.
Find below a list of the components included in sgcWebSockets Library.