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

Sign in to queue

Description

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:

Tags:

WCF, ASP.NET

Day:

2

Code:

SAC-807T

Room:

Stinger

Embed

Download

Download this episode

For more information, check out these courses on Microsoft Virtual Academy:

The Discussion

  • User profile image
    baokeyai

    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?

    Cheers!

  • 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
    Gilles

    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"

    http://msdn.microsoft.com/en-us/library/ff402558(v=vs.92).aspx

  • User profile image
    Sosh

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

  • User profile image
    ojorma

    Great, great.

  • User profile image
    JHubSharp

    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:

    http://www.paulbatum.com/2011/09/getting-started-with-websockets-in.html

  • 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
    Fred

    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: 

    http://www.paulbatum.com/2011/09/getting-started-with-websockets-in.html

  • User profile image
    leggetter

    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
    Damian​Edwards

    @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
    Tom

    @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
    Matt

    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!

    Matt

  • User profile image
    Vinayak

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

    Thanks in advance

Add Your 2 Cents