简体   繁体   中英

WebSocket fallback server side

I'm using fleck (https://github.com/statianzo/Fleck) on the server side to support WebSockets on a web page. This works very well and I really like the minimalistic approach in fleck, the lack of extensive configuration requirements and that it's written in .NET. On the downside, though, it does not have a any fallback implementation. I've been searching quite alot, but I can't seem to find a similar ajax long-pollong or flash solution to combine with fleck. I believe node.js and socket.io has this built in, but there doesn't seem to be an easy way to integrate those with .NET. I've found some other .net implementations as well, but not with the compactness of fleck.

Any advice or pointers are greatly appreciated. Thanks!

You don't need a fallback implementation. Either use websockets, and make the caller use them, or don't.

  • If you are using websockets, ensure that this is acceptable to your users.

  • If it is not acceptable to all your users, don't use websockets. Make them poll as often as needed.

There is no point in maintaining two.

I found that it is very simple to add an ajax fallback, using MVC3; http://www.cleancode.co.nz/blog/739/ajax-aspnet-mvc-3

Since IE9 does not support web sockets but current Safari/Firefox/Chrome/IE10/etc. do then supporting long polling as a fallback does make a lot of sense IMNSHO.

The "simple" solution would be SignalR (http://signalr.net) - unfortunately to get the websocket part to light up you need to be running on Windows 8 - other than that you can concentrate on your application with SignalR abstracting away the transport details for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM