High performance TCP Client in .net

霸气de小男生 提交于 2019-12-23 01:13:32

问题


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

High performance TCP server in C#

How to write a scalable Tcp/Ip based server

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 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?).


回答1:


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

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.



来源:https://stackoverflow.com/questions/32817517/high-performance-tcp-client-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!