I am developing a ASP.NET MVC app deployed on Azure, and looking for a library providing asynchronous transport mechanism/fallback.
After my own research, I've concluded that there are two well-known candidates - Socket.io and SignalR.
My question is simple) What's the pros and cons of them? It there any good reason to use one over the other?
thanks :)
For most applications, we recommend SignalR over raw WebSockets. SignalR provides transport fallback for environments where WebSockets isn't available. It also provides a basic remote procedure call app model. And in most scenarios, SignalR has no significant performance disadvantage compared to using raw WebSockets.
There are many alternatives for signalR that are used, like Firebase, pusher, webRTC, RabbitMQ, gRPC, and MQTT.
SignalR is like Socket.IO in that it supports transport negotiation/fallback. It is a framework and not a server, so you need to host it on a server of some sort. We have hosts for ASP.NET, OWIN (e.g. Kayak) and self-host, so you can run it in your own process easily, e.g. a Windows service.
Socket.IO is way more than just a layer above WebSockets, it has different semantics (marks messages with name), and does failovers to different protocols, as well has heartbeating mechanism. More to that attaches ID's to clients on server side, and more. So it is not just a wrapper, it is full-featured library.
I'd have to say that SignalR is definitely the best approach for your application. With the current build our laptops serving as servers are pushing around 350k messages/s. With the next release it will be even higher (several multiples higher judging by current tests).
Check out the main site: http://signalr.net/
The GitHub: https://github.com/SignalR/SignalR
JabbR for questions: http://jabbr.net/#/rooms/signalr
I've never used SignalR and according to what google tells me it is a replacement solution for .Net apps.
So I guess you should give it a try. Socket.IO is awesome, I love it but I'm a noder. According to their doc there is no .net/c# bindings. Maybe their doc is not up to date.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With