SocketServer设计

编程入门 行业动态 更新时间:2024-10-28 08:23:49
本文介绍了SocketServer设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要编写一个接受大约100个连接的套接字服务器,但 这可能会增加到1000或更多的时间。数据吞吐量将是最小的,大多数是短随机爆发,但重要的是那些 连接保持活跃状态​​。 谷歌搜索了一下,我知道在.NET中有64个插槽 连接的限制?你是如何克服的?我应该为每个连接创建一个 的新线程吗?鉴于 少量数据,这看起来有点浪费。 (在2分钟的爆发中只有30个字节)。 Stuart。

I need to write a socket server that accepts around 100 connections, but this could grow to a 1000, or more in time. The data throughput will be minimal, mostly in short random bursts, but it''s important those connections stay active. Having googled a bit, I understand there is a limit of 64 socket connections in .NET? How do you overcome that? Should I be creating a new Thread for every connection? It seems a bit wasteful, given the small amounts of data. (as little as 30 bytes in a 2 minute burst). Stuart.

推荐答案

Stuart< ; ST **** @ stu.uk>在新闻中写道:37 ************* @ individual: Stuart <st****@stu.uk> wrote in news:37*************@individual: 谷歌搜索了一下,据我所知有64个插座连接的限制在.NET?你是如何克服的?我应该创建一个 www.indyproject/ - 免费提供来源。 每个连接的新线程?鉴于少量数据,这看起来有点浪费。 (在2分钟的爆发中只有30个字节)。 Having googled a bit, I understand there is a limit of 64 socket connections in .NET? How do you overcome that? Should I be creating a www.indyproject/ - Free with source. new Thread for every connection? It seems a bit wasteful, given the small amounts of data. (as little as 30 bytes in a 2 minute burst).

取决于。你可以使用UDP还是必须是TCP? - Chad Z. Hower(又名Kudzu) - www.hower/Kudzu/ 编程是一种反击的艺术形式 ; 让你的ASP.NET应用程序运行得更快 www.atozed/IntraWeb/

>>谷歌搜索了一下,我知道有一个限制在64位套接字 >>Having googled a bit, I understand there is a limit of 64 socket .NET中的连接?你是如何克服的?我应该创建一个 connections in .NET? How do you overcome that? Should I be creating a

www.indyproject/ - 免费提供资源。

www.indyproject/ - Free with source.

看起来很有趣 - 谢谢。如果可能的话,我想避免使用第三方库 ,因为我可能会稍后将其移植到Linux / Mono上。 值得一看。

Looks interesting - Thanks. I would like to avoid a 3rd party library if possible, as I may look at porting this over to Linux/Mono later. Worth a look though.

每个连接的新线程?鉴于少量数据,这看起来有点浪费。 (在2分钟的爆发中只有30个字节)。 new Thread for every connection? It seems a bit wasteful, given thesmall amounts of data. (as little as 30 bytes in a 2 minute burst).

取决于。你能使用UDP还是必须是TCP?

Depends. Can you use UDP or must it be TCP?

必须是TCP。我正在为已经存在 的客户编写网关/代理服务器。 S.

Has to be TCP. I''m writing a gateway/proxy server for clients that already exist. S.

Stuart< st **** @ stu.uk>在新闻中写道:37 ************* @ individual: Stuart <st****@stu.uk> wrote in news:37*************@individual: 看起来很有趣 - 谢谢。如果可能的话,我想避免使用第三方库,因为我可能会稍后将其移植到Linux / Mono上。值得一看。 Looks interesting - Thanks. I would like to avoid a 3rd party library if possible, as I may look at porting this over to Linux/Mono later. Worth a look though.

免费 - 并且有来源。 .NET可用,但非常有限: http:// www .indyproject / Features.iwp

取决于。你能使用UDP还是必须是TCP? Depends. Can you use UDP or must it be TCP?

必须是TCP。我正在为已经存在的客户编写网关/代理服务器。

Has to be TCP. I''m writing a gateway/proxy server for clients that already exist.

一旦你达到大约1,000,线程肯定会成为一个问题。 99% 的服务器应该是线程化的,但在你的情况下,如果它只是在做小数据传递而不是很多,那么问题就在于1% 会话逻辑。 - Chad Z. Hower(又名Kudzu) - www.hower/Kudzu/ 编程是一种打架的艺术形式返回 在更短的时间内更轻松地开发ASP.NET应用程序: www.atozed/IntraWeb/

更多推荐

SocketServer设计

本文发布于:2023-11-23 14:27:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621773.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SocketServer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!