So… ASP.NET MVC and WebSockets?

后端 未结 3 616
無奈伤痛
無奈伤痛 2021-01-31 12:16

I have an application in MVC 3 and I\'m looking to add WebSockets (with fallback to Comet) to it.

I\'ve researched a bit and I found out the Comet part is pretty straigh

3条回答
  •  后悔当初
    2021-01-31 12:36

    As a point of reference for this thread on WebSockets - I want you to note that at first glance, WebSockets looks like the obvious choice. The API is designed to provide a bi-directional communication channel between browser and server over a single TCP socket. It's been standardized by the IETF, and the latest Chrome, Firefox, IE, and Opera browsers support WebSockets. It's designed to minimize bandwidth overhead by reducing HTTP message overhead. So, what's not to like?

    Like any perceived silver bullet, things are not always what they seem. Lots of problems exist:

    Browser Support: As of June 2012, only 47.64% of browsers currently in use actually support WebSockets http://caniuse.com/websockets - That means, no matter how good WebSockets appears, you still need a second "fallback" solution to support the majority of Internet users. And since most "fallback" solutions involve Flash, you’re still out of luck on iOS and other mobile devices.

    Read more about WebSockets in reality from this blog post: Are HTML5 WebSockets Gateway and Server the Panacea for Real-Time Data Push

    Browser Support Update: As of May 2019, 96.77% of browsers currently in use actually support WebSockets http://caniuse.com/websockets

提交回复
热议问题