Node.js的+ Socket.IO VS SignalR VS C#的WebSocket服务器 [英] Node.Js + Socket.IO vs SignalR vs C# WebSocket Server

查看:2214
本文介绍了Node.js的+ Socket.IO VS SignalR VS C#的WebSocket服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有写在接收和提交信息到客户的.Net TCP服务器应用程序。我期待在构建Web应用程序因此需要通信层。

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.

我建立了一个Node.js的+ Socket.IO应用程序,它连接到我的TCP服务器,然后推通信的Web应用程序和一切工作正常。

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.

我刚刚读到SignalR作为替代以保持它的净栈。

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

不过,我也发现,我可以写一个C#的WebSocket服务器,一个基本的演示这里

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

我认为这个基本的服务器是SignalR是在它了更多的功能?

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

我试图来决定是我刚刚追加我的当​​前TCP的应用程序使用的WebSocket服务器还是我下去独立SignalR或Node.js的路线?出于利益考虑如何做一个SignalR的应用程序运行,它是作为Windows服务,控制台应用程序或IIS服务?

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?

推荐答案

SignalR就像Socket.IO,它支持传输谈判/回退。这是一个框架,而不是一个服务器,所以你需要主持它某种类型的服务器上。我们对ASP.NET,OWIN(例如独木舟)和自我宿主主机上,这样你就可以在自己的过程中容易运行它,例如Windows服务。

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一直支持客户的浏览器(JS),.NET,Windows Phone 7的和Silverlight。也有客户贡献的东西像iOS的,单声道触摸等。

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会给你一个更高层次的API比原始套接字这是它的一大优势,让你做的事情,如RPC从服务器到客户端的广播(或定位)的方式。

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.

这篇关于Node.js的+ Socket.IO VS SignalR VS C#的WebSocket服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆