Node.Js + Socket.IO vs SignalR vs C # WebSocket Server

I currently have a TCP server application written in .Net that receives and sends messages to clients. I am looking at creating a web application, so you need a level of communication.

I built a Node.JS + Socket.IO application that connects to my TCP server and then sends the message to the web application and everything works fine.

I just read about SignalR as an alternative to keep it on the .Net stack.

However, I also found that I could write C # Websocket Server, a basic demo here

I assume that this core server is what SignalR is, but obviously with a lot more features in it?

What I'm trying to solve is just to add the current TCP application with the Websocket server or go to a separate SignalR or Node.js route? Of interest, how does SignalR work, is it a Windows service, a console application, or IIS?

+57
c # websocket signalr
Mar 02 2018-12-12T00:
source share
3 answers

SignalR is similar to Socket.IO in that it supports transport consistency / backup. This is a framework, not a server, so you need to host it on some server. We have hosts for ASP.NET, OWIN (like Kayak) and self-service, so you can easily run it in your own process, for example. Windows service.

SignalR supports clients for browsers (JS), .NET, Windows Phone 7, and Silverlight. There are also clients for things like iOS, Mono Touch, etc.

SignalR will provide you with a higher level API than the source sockets, which is its great advantage, allowing you to do things like “RPC” from server to clients in broadcast (or target) mode.

+66
Mar 05 2018-12-12T00:
source share

Some consequences that were missed

I used both technologies and worked on both sides of the .NET / node stacks.

  • Although I prefer the node side these days, if you only work in .NET, SignalR is the obvious choice. And vice versa, if you build all your projects in node, I would go with socket.io or sockjs . If your coverage is narrow enough, you do not need to worry about backup and similar things, I would recommend checking out the ws module, as it is simpler and easier in your dependencies. Socket.io used to hurt on Windows due to installing problems with node-gyp, unable to install its own dependencies ( node-gyp requires many configuration steps, which vary greatly depending on which version of Windows you have, but is necessary for the built-in built-in C ++ modules). UPDATE . This Windows bit is not that important thanks to windows-build-tools .
  • If you have a load balancer and you plan to run SignalR, you will need to configure SQL or Redis as a backplane to bypass load balancing. You will have similar problems with the .io socket, and there are [several supported methods] [1] (1 of which is also redis).

Update - removed jquery info as it is no longer applicable

+15
Mar 15 '15 at 1:34
source share

Designing a reliable scalable stream TCP server can be a daunting task. On the other hand, there are very good resources on the Internet to start your own. For example, if you are just looking for good open source WebSocket projects, I would advise:

Alchemy Project : C # WebSocket Open Source Library

Fleck Project : C # Websocket Library Open Source Library

SignalR may be nice, but Windows Server 8 / IIS 8 is required to provide the WebSocket feature.

On the commercial side, especially considering that the websocket function is not available in all browsers, I recommend PokeIn WebSocket and the reverse Ajax library. Starting with version 2.0, it has a built-in WebSocket server. Details are available here.

+13
Mar 05 2018-12-12T00:
source share



All Articles