Building real-time web apps with WebSockets using IIS, ASP.NET and WCF

Download this episode

Download Video


WebSockets is a new technology under joint development by Microsoft and other industry leaders, designed to enable secure, real-time bidirectional communication across the Web. Windows 8 has a comprehensive WebSocket offering with support in IE10, Metro style apps, WCF and ASP.NET. Come learn how HTML5 apps can make dramatic improvements in terms of user experience and performance by taking advantage of this exciting technology.
For more information, check out these courses on Microsoft Virtual Academy:











Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      I really enjoyed the session, is there a location to download the chat app source leveraging SignalR? Additionally, you guys mentioned that WebSockets support load balancing, is there magic that automatically notifies each server in the cluster of all the clients to broadcast or is there some configuration?


    • User profile image
      Paul Batum

      Glad to hear that you enjoyed it! I'll try to find out about the source code for the SignalR chat and see if someone can post a link here.

      You ask a good question regarding load balancing and this is something that I wish we had more time during the session to dive into the technical details on. The short answer is no we don't have any magic to do what you are describing. WebSockets works well with TCP load balancers in that a single client will stay connected to the same server, however if you want to do broadcast to clients that are connected to different servers then right now you would need to implement this yourself. SignalR does have some hookpoints that should make it easier to implement this and you can be sure you will be hearing more from us in the future about solving these scale out problems (and not just in the SignalR space, this is important for WCF as well).

    • User profile image

      Is the WNS service based on this technology?

    • User profile image
      Paul Batum

      I know very little about WNS but I'm confident that it does not utilize WebSockets. If I had to hazard a guess I would say that WNS is probably based on SMS or something similar. One of the reasons I say this is because WNS notifications have to be really small ( < 4k):

      "The maximum size of a notification is 1 KB for the header and 3 KB for the payload. Notifications exceeding these limits will be discarded"

    • User profile image

      This should come with a warning about the screech at 12.35 - nearly deafened me with headphones on...

    • User profile image

      Great, great.

    • User profile image

      So do I understand that this will only work on Windows 8 currently? If I were to download the vNext developer bits on my Win7 box would the WebSocket stuff not function?

    • User profile image
      Paul Batum

      Correct. You would get something like a "PlatformNotSupportedException". 

      If you'd like step by step instructions in setting up a Win8 preview machine and running the samples we showed in this talk, they are now available on my blog:

    • User profile image
      Dominic Pettifer

      Any word on whether ASP.NET 4.5 + WebSockets will be supported in IIS 7.0 - 7.5, and possibly IIS 6.0?

      While we can easily get clients to upgrade their .NET version, getting them to upgrade their server software is nigh on impossible.

    • User profile image
      Paul Batum

      Hi Dominic! I understand where you are coming from, but WebSockets is a new feature for IIS 8.0. At this stage there is no plan to support earlier versions of IIS. 

    • User profile image

      Where to find the sample of this session online?

    • User profile image
      Paul Batum

      Hi Fred, I wrote a blog post that covers how you can try out the samples using the Windows 8 developer preview:

    • User profile image

      Are there any metrics available that state how many concurrent WebSocket connections IIS + SignalR can support on a machine with a specification X? (maybe an Amazon EC2 small instance as an example). Any metrics on concurrent connection support in addition to standard HTTP requests? If so, a point in the right direction would be great. Thanks.

    • User profile image

      @undefined:for SignalR, we've sucessfully connected >100,000 concurrent clients to a single box. This is idle connections. I'm currently working on profiling and load testing SignalR with active connections and hope to have more numbers soon. FWIW, supporing lots of concurrent idle connections is pretty easy in IIS/ASP.NET if they're hitting asynchronous handlers and you tweak some settings. You'll only be limited by memory in real terms. Once you start adding traffic is when it gets really interesting Smiley

    • User profile image

      @DamianEdwards ,although it is a "pretty" library keeping 100,000 or 1million connections doesn't make any sense unless you can send them the same message the same time which is impossible with SignalR due to lack of chunk management, several IIS dependency etc.

      It is a good start but lots of missing.

    • User profile image

      Have there been any tests with sending video from client to server or the other way? I'm very excited about this either way, great conference!


    • User profile image

      any code for doing it for one to one and one to many video chat and conference?

      Thanks in advance

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.