37

Is there a simple, down to earth, sample/example/tutorial for WebSockets Server and Client implementation in ASP.NET 4.0 to get me started? I know this question has been asked, but it hasn't been answered properly. There is a lot of stuff about client side, but cannot find a simple explanation about server-side in ASP.NET

Thanks!

~Update: I Found this tutorial, but cannot make it work, the connection closes right after attempting to connect. any one can make it work? http://www.undisciplinedbytes.com/2010/06/html-5-c-web-sockets-server-and-asp-net-client-implementation/

Sergej Popov
  • 2,933
  • 6
  • 36
  • 53

1 Answers1

29

ASP.NET won't support WebSockets until Windows Server 8/IIS 8. See here.

There's this tutorial, Getting started with WebSockets in the Windows 8 developer preview, from September 2011.

If you want to see a working WebSocket server in .NET I'd recommend taking a look at SuperWebSocket which is open source. If you just want to use a .NET WebSocket server then SuperWebSocket (again), XSockets and Fleck are worth a look.

SignalR also relies on Windows 8. See the SignalR WebSockets docs.

Shachaf.Gortler
  • 5,655
  • 14
  • 43
  • 71
leggetter
  • 15,248
  • 1
  • 55
  • 61
  • I was looking for tutorial not the implementations. but will choose this as answer since you pointed me to Fleck which so far seems the simplest. Thanks! – Sergej Popov Feb 05 '12 at 14:51
  • Here's a tutorial using pure .NET WebSockets - no frameworks: http://www.codeproject.com/Articles/618032/Using-WebSocket-in-NET-4-5-Part-2 – Nilzor Dec 12 '13 at 19:42