c# alternative to socket.io for node.js [closed]

2020-05-27 09:22发布

问题:

Is there something like socket.io (node.js) for C# ? I need a server version of it.

Thanks for your help!

回答1:

I do not think there is any framework in .NET which has evented IO support like node.js or ruby's EventMachine or python twisted :-(.



回答2:

SignalR

Async signaling library for .NET to help build real-time, multi-user interactive web applications.

https://github.com/SignalR/SignalR

You can see a live example of it in play here http://jabbr.net/

You will need IIS 8.0 to get web sockets, it uses long-polling on IIS 7.

I think they may be working on using https://github.com/davidfowl/Fleck and https://github.com/davidfowl/SignalR.Fleck to show how you can use Fleck web socket server with SignalR



回答3:

.NET has a number of ways to implement a 100% async design similar to node.js.

See Socket's BeginSend/EndSend and higher-performance SendAsync, or Stream's BeginRead/BeginWrite methods. These are all very similar to node.js.

C# 5.0 is bringing in a new async design with language support that will be a lot easier to use than those above. You can play around with a beta of it in the Async CTP.



回答4:

Just saw a video from mix11, where they talked about Manos de Mono. It is a C# framework modeled after tornadoweb with inspiration from frameworks like node.js.

https://github.com/jacksonh/manos



回答5:

There is also another library called XSockets

http://xsockets.net/

They also include a fallback for browsers that don't implement the WebSocket protocol Fallback via Flash



回答6:

This has just been released, documentation and examples are on the way!

https://github.com/kayak/kayak https://groups.google.com/forum/#!topic/kayak-http/LXS_xh0qurM

You may also want to check out http://superwebsocket.codeplex.com/

I'm not sure if it uses a single thread or thread-pool though.. But that will only be a problem once you want to have 1000s of connections at any one time.