BUILD2011

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

Download this episode

Download Video

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

Format

Available formats for this video:

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

    The Discussion

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

    • 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).

    • Gilles

      Is the WNS service based on this technology?

    • 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

    • Sosh

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

    • ojorma

      Great, great.

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

    • 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

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

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

    • Fred

      Where to find the sample of this session online?

    • 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

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

    • 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

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

    • 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

    • Vinayak

      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 continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.