Confused by Microsoft WebSockets namespaces

I will add little bit more to your confusion. Microsoft.* prefixed assemblies / namespaces are usually either very specific to some language or not part of .NET framework (shipped out of band (or prototypes)).

Assemblies / namespaces shipped with .NET framework usually start with System.*. There are two namespaces containing features related to WebSockets in .NET 4.5:

  • System.Net.WebSockets - implementation of WebSockets
  • System.Web.WebSockets - integration of WebSockets with ASP.NET

I haven't see System.ServiceModel.WebSockets but I think there was some prototype named Microsoft.ServiceModel.WebSockets


html5labs.interoperabilitybridges.com:

...we don't plan any future updates to this prototype.

System.Web.WebSockets:

...namespace contains classes that support adding WebSocket functionality to ASP.NET Web Forms applications.

Microsoft.Web.WebSockets:

...provides functionality for writing WebSocket-enabled server applications on Windows 8 using ASP.NET and WCF


My conclusion:

  • System.Net.WebSockets seems like something low-level.
  • System.Web.WebSockets need when you use ASP.NET Web Forms
  • Microsoft.Web.WebSockets from NuGet looks like best choice when you use ASP.NET MVC

@Greg Woods re System.ServiceModel.WebSockets: you weren't imagining it.

http://html5labs.interoperabilitybridges.com/media/1165/readme.htm


As for the Microsoft.Web.WebSockets vs System.Web.WebSockets...

I think that:

System.Web.WebSockets- gives you a lower api for working with websockets

while...

Microsoft.Web.WebSockets- is kind of a higher api, which makes it far more easy to deal with, and also tries to mirroring the events/functions that are in the html5/javascript specification (e.g.- onerror,onopen, onmessage,onclose, send, etc...)