.net中的高性能TCP客户端 [英] High performance TCP Client in .net

查看:123
本文介绍了.net中的高性能TCP客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SO上看到的许多有关.Net套接字的好文章都是围绕编写可伸缩的高性能服务器.

A lot of the good posts on .Net sockets seen on SO are around writing scalable high performance servers.

C#中的高性能TCP服务器

如何编写可伸缩的基于Tcp/Ip的服务器

尽管这些文章非常好,但是编写高性能 TCP Client 应用程序时要重点关注哪些核心内容?

While those posts are very good, what are the core things to focus on when writing high performance TCP Client Applications?

高性能客户端的方案是将请求流式传输到服务器并以非阻塞方式处理响应的应用程序.

A scenario for a high performance client would be an application that streams requests to a server and processes responses in a non-blocking fashion.

这样的客户端还应该具有可靠的断开连接检测策略.

Such a client should also have a strategy for reliable disconnect detection.

为进一步说明,我们无法控制服务器端.

To further clarify, we have no control over the server end.

我们只是有一个要连接的服务器端点.

We simply have a server endpoint to connect to.

zmqNet是一个很棒的库,但我认为它的最强(或在某些情况下意味着)连接的两端都在使用zmq(是吗?).

zmqNet mentioned in the comments is a great lib, but I think its strongest (or meant for cases) where both ends of the connection are using zmq (true?).

推荐答案

使用netMQ(0MQ).它以NuGet软件包的形式提供,因此应该易于维护.

Go with netMQ (0MQ). It's available as a NuGet package so that should be easy to maintain.

我建议使用客户端请求套接字和服务器端的路由器/经销商结构.此处提供的文档: http://zguide.zeromq.org/page:all 非常好.

I'd suggest something like a client-side request socket and a router/dealer construction on the server side. The documention providere here: http://zguide.zeromq.org/page:all is excellent.

这篇关于.net中的高性能TCP客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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