最大TCP连接到一台机器一台、连接到、机器、最大

2023-09-04 01:00:13 作者:望断归来路

我在.NET到N多的客户端可以连接创建一个Windows服务。该服务启动TCP监听和接受客户端连接。 我现在面临的问题是,我只能开10个连接到该服务。监听:: AcceptTcpClient()方法只接受10连接,并抛出一个异常,第11名之一。 客户端应用程序使用System.Net.Sockets.TcpClient类和服务使用System.Net.Sockets.TcpListener类。

I am creating a Windows Service in .NET to which N number of client can connect. The service starts a TCP listener and accepts the client connections. The problem I am facing is that I can only open 10 connections to this service. The listener::AcceptTcpClient() method accepts only 10 connection and throws an exception for 11th one. The client application uses the System.Net.Sockets.TcpClient class and the service is using System.Net.Sockets.TcpListener class.

这是我收到的时候我试图做一个连接数量在for循环到此服务(由10号连接后)异常:

This is the exception that I am getting when I try to make a number of connections in a for loop to this service (after the 10th connection is made):

无法读取传输连接数据:一个exsting连接被强行关闭远程主机

"Unable to read data from Transport connection: An exsting connection was forcibly closed by remote host"

推荐答案

这听起来像你正在运行到著名的 10连接在Windows XP 半开TCP连接限制。此限制是硬codeD为XP SP 2,有没有办法覆盖简短修补你的系统,它可能在技术上违反您的最终用户许可协议(IANAL)的。 XP是,唉,不打算成为一个服务器系统。

This sounds like you're running into the well-known 10-connection limit of half-open TCP connections on Windows XP. This limit is hard-coded as of XP SP 2, and there is no way to override it short of patching your system, which may technically violate your end-user license agreement (IANAL). XP is, alas, not intended to be a server system.

有关Windows XP专业版中,   其他计算机的最大数目   被允许同时   通过网络连接为10。:此   限制包括所有传输和   资源共享协议相结合。   对于Windows XP Home Edition中,   的其他计算机的最大数量的   被允许同时   通过网络连接是五。本   限制是同时的数   从其他计算机会话   系统允许主机。本   限制并不适用于使用   从重视管理工具   远程计算机。

For Windows XP Professional, the maximum number of other computers that are permitted to simultaneously connect over the network is ten. This limit includes all transports and resource sharing protocols combined. For Windows XP Home Edition, the maximum number of other computers that are permitted to simultaneously connect over the network is five. This limit is the number of simultaneous sessions from other computers the system is permitted to host. This limit does not apply to the use of administrative tools that attach from a remote computer.