WebSockets are bidirectional, full-duplex channels that start as HTTP channels and use handshakes to upgrade the channels to WebSockets, with real, two-way TCP communication between the client and the server. The added benefit is that all of this can happen through port 80 and that they are router friendly.
In this recipe, we will see how to create and consume a WebSockets service.
In order to use this recipe, you should have Windows 8 with Visual Studio 2012 installed. WebSockets are only supported natively on Windows 8; see http://msdn.microsoft.com/en-us/library/hh159285.aspx.
Here, we are going to set up our system in order to support WebSockets and implement a basic WebSocket.
First, we need to validate that the following Windows features are installed on our Windows 8 machine:
ASP.NET 4.5 and HTTP activation
WebSockets over Internet Information Services
Open Visual Studio 2012; create a new project by navigating to Visual C# | Web and use the ASP...