Max TCP Connections to a machine

∥☆過路亽.° 提交于 2019-12-03 09:05:52

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.

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.

I don't think the answer that was given before is valid. I did some research and there doesn't appear to be a reason that TcpClient has any strict limit imposed. The other answer suggested a limit of 10 active TCP connections in Windows XP for a server service, but this is only true for specific application protocols (such as sharing, mail) provided by Microsoft.

I did find though that Microsoft added some restrictions in XP SP2 and continued through Vista SP1 to limit half-open TCP connections to 10. They also limited the number of new connections to 10 within a single second. These were both attempts to reduce the impact of virus software. Apparently these have not been very successful so Microsoft has finally decided to remove these in Vista SP2 and later.

This may have been the OP's actual issue - perhaps you are trying to create those connections too quickly in the client?

As I mentioned in my comments on the previously accepted answer, I personally write client/server software and have not had problems with a limit of 10. When I do tests, using Windows XP in the past and now with Windows 7 (the application limit is now at 20 connections), I am able to easily exceed this limit. I just retested and was able to create >140 active/established connections between one host (Windows 7 Home Premium) and another host (Windows 7 Enterprise); both client operating systems. This is using Java but there really should be no difference with .NET (which I've also tested in the past).

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