开发者

Websockets with ASP.NET MVC / MVVM

Earlier today I came across Kaazing's WebSocket API for HTML5.

Looks fantastic, but as I am only now researching WebSocket possibilities for real-time financial updating, I would like to hear some recommendations, and pitfalls to avoid when planning out this architecture.

I'm looking at ASP.Net MVC, and possibly some WPF/Silverlight MVVM.

Are there other WebSocket API's that are better (and why), and some good examples?

Also, what kind of traffic can WebS开发者_运维百科ockets handle? I mean, if we have over a million users on a system updating real-time, how do hardware requirements change because the software architecture implements WebSockets?


A late answer. Here is a WebSocket Server (framework) that is based on .NET and has support for modelbinding / controller and validations etc. in a way that reminds of MVC. It is very easy to get started using it. Just create a new MVC3 Project and type:

Install-Package XSockets

Using the Package Manager Console in Visual Studio

More info on http://xsockets.net

And yes, it supports RFC6455 and Hibi00 and has a fallback for "older" browsers.


I figured I'd come back at this, now that I have a solution ready for production. I took a look at a few vendors that basically charge a lot of money for something you can essentially build yourself. They all have good products, and if your time to market is critical, those prefab options may be the best in the short run.

After poking around with Node.JS with Socket.IO, I shifted my attention to SignalR - an asynchronous signaling library for .NET to help build real-time, multi-user interactive web applications, and used the hub implementation.

It manages all the heavy lifting and connection building with just a few lines of JavaScript, and automatically selects the appropriate transport protocol for the connection.

For a load-balanced environment, implementation of a caching server such as Redis is required.


Here's a C# implementation of a Web Socket client and server on CodeProject:

Web Socket Server


I think following links will help you..

The WebSockets prototype with Silverlight, HTML Bridges and JavaScript

Silverlight and WebSockets (Mike Taulty's blog)


https://github.com/Olivine-Labs/Alchemy-Websockets

Here's an open source websocket server and client library. C#/Javascript. Includes fallback to flash sockets for browsers that don't have websockets yet. Tested on most web browsers including mobile ones, works everywhere.

Realtime financials? I don't know how many connections you plan on handling but this one is also the most scalable solution available right now.


Although the number of browsers are quite limited for websockets, mobile browsers have support for that. But i would be considering the use of more cross browser friendly choices like PokeIn reverse ajax library

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜