Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
945 views
in Technique[技术] by (71.8m points)

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

I currently have a TCP server application written in .Net that receives and submits messages to clients. I am looking at building a web application so need the communication layer.

I have built a Node.JS + Socket.IO app which connects to my TCP server and then pushes communication to the web application and all works fine.

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

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

I assume that this basic server is what SignalR is but obviously with a lot more functionality in it?

What I'm trying to decide is do I just append my current TCP application with a Websocket server or do I go down a separate SignalR or Node.js route? Out of interest how does a SignalR application run, is it as a Windows service, console app or IIS service?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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

SignalR will give you a much higher level API than raw sockets which is its big advantage, allowing you to do things like "RPC" from server to clients in a broadcast (or targeted) fashion.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...