So... ASP.NET MVC and WebSockets? | asp net mvc socket
IhaveanapplicationinMVC3andImlookingtoaddWebSockets(withfallbacktoComet)toit.IveresearchedabitandIfoundouttheCometpartisprettystraightforwardandIdmuchratherdoitmyself.JustAsyncControllersandaprettyplainbitofjsisallthatsrequiredtohandlethoselong-livedajaxrequests.Now,inthecaseofWebSocket,thingsstarttogetdirty.Ivelookedatafewlibraries,buttheymostlyseemtosetupawebserver(thereforeneedinganotherhost,orport)oftheirown,andlistentowsprotocolrequeststhere.ThisisthecaseforinstanceforSuperWebSocket[1],...
I have an application in MVC 3 and Im looking to add WebSockets (with fallback to Comet) to it.
Ive researched a bit and I found out the Comet part is pretty straightforward and Id much rather do it myself. Just AsyncControllers and a pretty plain bit of js is all thats required to handle those long-lived ajax requests.
Now, in the case of WebSocket, things start to get dirty. Ive looked at a few libraries, but they mostly seem to set up a web server (therefore needing another host, or port) of their own, and listen to ws protocol requests there. This is the case for instance for SuperWebSocket[1], which seemed nice at first, but had this "Im a web server" issue (which is perfectly fine of course, but Id rather avoid).
Then I looked at "PingIt" or something like that, I cant find the link now.., I do have the source on another computer though. This one DOES run on an endpoint in mvc, but I didnt quite like the way in which it handles thi...