WebSockets with .NET

WebSockets offers a whole new way of building for the web.

The .NET Framework is particularly convenient way of building WebSockets server and client applications. The next version of the framework is already available to download and try out -- right now. From .NET 4.5 upwards, the .NET Framework provides a Microsoft.Web.WebSockets namespace which makes WebSocks astonishingly quick and easy.

Visual Studio 2011 and .NET 4.5 were announced at Microsoft's recent BUILD event. We've already heard the exciting news about HTML5 support including WebSockets in Windows 8.

The brave new HTML5 era, along with the WebSockets API, has arrived. The latest version of every major web browser already supports WebSockets. Every major browser vendor is adopting the WebSockets API along with the HTML5 specification.

Web apps have evolved. WebSockets provide capabilities and features that are absolutely integral to the future of web applications. WebSockets releases developers from the constraints of HTTP that we've had to work with for the past tw decades.

This type of architecture is already extremely popular and widely used, especially in applications targetting specific clients e.g. on mobile devices. WebSockets usage is growing fast. 

Yet, currently, implementing WebSockets on some development platforms involves writing a large amount of code just to provide basic functionality. It doesn't have to be this way. The vast majority of this could and should be provided by the framework, leaving developers to focus on useful functionality, which is of course the purpose of a framework.

Amazing third-party WebSockets frameworks available right now

There's no better way to get started with WebSockets than to download one of the many excellent open-source libraries and demos out there. There's an excellent demo of WebSockets using .NET4.5, from BUILD/Win8. Other reccomended examples include SignalR (a .NET equivalent of Socket.IO), or SuperSockets, or C# WebSocketServer, etc. Various other WebSockets platforms are also available and worth being aware of, including a commercial WebSockets platform developed by Kaazingwhich supports all web browsers from IE6 onwards. Kaazing have published slides for an informative presentation on WebSockets. (I would be interested in trying a native Windows 8 implementation/port of Sockets.IO server, if/when one is available, and would be interested in collaborating to produce such a project.)


03 November 2011

Share the love:

Comments: 6

Add Comment

Tim Acheson (03 Nov 11, 15:14)

Please add your vote to the campaign for a WebSockets library in .NET -- an important feature request on the official Visual Studio/.NET user portal

Thank you.

Tim Acheson (03 Nov 11, 15:17)

Tweeted -- please retweet! ;)

Tim Acheson (03 Nov 11, 15:23)

I've also raised this issue as a question in the official .NET forums.

Agreed Tim - I haven't seen a simple solution out there yet. I have added my vote to that link.


  • Twitter
  • LinkedIn
  • Facebook
  • Windows Live / Messenger
  • Xbox Live
  • RSS
  • Email