So far, in tutorials, blogs, and official documentation, I've seen:
are these somehow different? Are some older versions?
I've always assumed the 'Microsoft.Web' namespace was used for pre-release code, but even the demos at the Build conference use this namespace, despite the fact that .NET 4.5 includes the System.Web.WebSockets namespace built in.
System.Web.WebSockets seems to have the same API as Microsoft.Web.WebSockets, but with classes and methods prefixed with AspNet.
System.ServiceModel.WebSockets is part of the WCF namespace, which also seems a sensible place to put this stuff.
Help - I'm confused. What should I be using?
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 WebSocketsSystem.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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With