如何在C#中有效地处理套接字连接 [英] How to efficiently handle socket connection in C#

查看:89
本文介绍了如何在C#中有效地处理套接字连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我目前有超过10000个套接字客户端试图连接到我的C#套接字服务器的场景驻留在云虚拟机中,

I currently have scenario where more than 10000 socket client trying to connect to my C# socket server which resides in cloud VM,

我已经用以下方式编写了我的  套接字服务器,

I have written my  socket server in the below way,


此方法无法同时处理~1000套接字连接,

And this approach is not capable of handling ~1000 socket connection concurrently,

是否有任何有效的方法来处理这种情况,

Is there any efficient approach to handle this scenario,

请在此处建议所需的逻辑/架构更改。

Please suggest logic/architectural changes required here.

谢谢,Gowtham

Thanks, Gowtham

推荐答案

嗨Gowthamaprabhu S,

Hi Gowthamaprabhu S,

感谢您在此发帖。

对于您的问题,您可以尝试使用
thread

parallel
以提高效率。

For your question, you could try to use thread or parallel to make it more efficient.

最好的问候,

Wendy


这篇关于如何在C#中有效地处理套接字连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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