.Net 中的 python 扭曲等价物
我正在尝试在.Net 中编写一个套接字服务器。我刚刚读到twisted 并发现非常有趣。
是否有可用于 .Net 的等效库?
I am trying to write a socket server in .Net. I just read about twisted and found very interesting.
Is there any equivalent library available for .Net ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据 此页面,它看起来像 Socket对象现在对异步通信有一些基本支持。不过,就其精美的抽象而言,我不知道有什么与 Twisted 相当的东西。
此页面有一些使用新功能的示例异步 API(在 C# 中)。
According to this page it looks as though the Socket object now has some basic support for async communication. I don't know of anything equivalent to Twisted in terms of its polished abstractions though.
This page has some examples of using the new async APIs (in c#).
也许您可以看看Microsoft WAS。
Maybe you can take a look at Microsoft WAS.
不,没有等效的库。 Twisted 在一个中央代码库中集成了一套庞大的协议(包括客户端和服务器),以及异步请求/响应、错误处理、身份验证和来自网络的文件系统访问等内容的统一抽象。您可以从各种不同的 .NET 库以及内置的身份验证支持中拼凑出类似的东西,但据我所知,您无法将所有内容集中到一个地方。
IronPython 目前不是 Twisted 支持的平台,但没有理由不支持;如果您有兴趣一起使用它们,您可能需要进行一些测试,看看 Twisted 本身是否可以在 .NET 上运行。
No, there is no equivalent library. Twisted integrates a huge suite of protocols, both clients and servers, together in one central codebase, along with unified abstractions for things like asynchronous request/response, error handling, authentication and filesystem access from the network. You can cobble something similar together out of a variety of different .NET libraries, and the built-in support for authentication, but as far as I know you can't get it all in one place.
IronPython is not currently a supported platform for Twisted but there's no reason that it couldn't be; if you are interested in using them together you might want to do some testing and see if Twisted itself could run on .NET.