Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 WebSockets 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?

like image 373
ElHaix Avatar asked Feb 03 '11 19:02

ElHaix


2 Answers

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.

like image 181
Magnus Thor Avatar answered Nov 13 '22 18:11

Magnus Thor


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.

like image 4
ElHaix Avatar answered Nov 13 '22 17:11

ElHaix