I have a TCP listener service to which the clients connect. Lately I have started receiving this error related to disconnection. I connect around 20 clients to it and the connection works fine. But when I connect another 10 clients to the service, the previous connections break with a 10053 or 10054 error.
我有一个客户端连接的TCP侦听器服务。最近我开始收到与断开连接有关的错误。我连接了大约20个客户端,连接正常。但是当我将另外10个客户端连接到服务时,之前的连接会因10053或10054错误而中断。
Previously it used to run with 100 clients but I am not sure what could be the problem. The service and the clients both are running on Windows Server 2003 because I found that Windows XP has a known problem with multiple TCP connections (related to 10053).
以前它曾经运行过100个客户端,但我不确定可能是什么问题。服务和客户端都在Windows Server 2003上运行,因为我发现Windows XP存在多个TCP连接的已知问题(与10053相关)。
2 个解决方案
#1
Well, the errors you are receiving are very different.
那么,你收到的错误是非常不同的。
10053 is a WSAECONNABORTED - The connection was aborted. This is usually due to a problem in your application stack (though it just happens sometimes).
10053是WSAECONNABORTED - 连接已中止。这通常是由于应用程序堆栈中的问题(尽管有时会发生)。
10054 is a WSAECONNRESET - The connection was reset by peer. This is usually more an issue on the other side of the connection.
10054是WSAECONNRESET - 连接由peer重置。这通常是连接另一端的问题。
How are you testing this? Are the "clients" connecting to this service something you wrote? If so, you should track what's happening on the client side when you get a 10054.
你是如何测试的?连接到此服务的“客户”是否是您撰写的内容?如果是这样,您应该在获得10054时跟踪客户端发生的情况。
Also, this could potentially be due to network issues, unrelated to your software (directly). Has there been a change in the network infrastructure on which you are running?
此外,这可能是由于网络问题,与您的软件无关(直接)。您运行的网络基础架构是否发生了变化?
#2
I doubt it is a network problem, or you probably would see it happening when the first 20 clients connect. Just a shot in the dark, but how are you handling these connections? Are you using some sort of Array or Collection? Could you inadvertently be setting existing connections to new connections, causing the system to freak out?
我怀疑这是一个网络问题,或者你可能会在前20个客户端连接时看到它发生。只是在黑暗中拍摄,但你如何处理这些连接?你在使用某种数组或集合吗?您是否可能无意中将现有连接设置为新连接,导致系统崩溃?
#1
Well, the errors you are receiving are very different.
那么,你收到的错误是非常不同的。
10053 is a WSAECONNABORTED - The connection was aborted. This is usually due to a problem in your application stack (though it just happens sometimes).
10053是WSAECONNABORTED - 连接已中止。这通常是由于应用程序堆栈中的问题(尽管有时会发生)。
10054 is a WSAECONNRESET - The connection was reset by peer. This is usually more an issue on the other side of the connection.
10054是WSAECONNRESET - 连接由peer重置。这通常是连接另一端的问题。
How are you testing this? Are the "clients" connecting to this service something you wrote? If so, you should track what's happening on the client side when you get a 10054.
你是如何测试的?连接到此服务的“客户”是否是您撰写的内容?如果是这样,您应该在获得10054时跟踪客户端发生的情况。
Also, this could potentially be due to network issues, unrelated to your software (directly). Has there been a change in the network infrastructure on which you are running?
此外,这可能是由于网络问题,与您的软件无关(直接)。您运行的网络基础架构是否发生了变化?
#2
I doubt it is a network problem, or you probably would see it happening when the first 20 clients connect. Just a shot in the dark, but how are you handling these connections? Are you using some sort of Array or Collection? Could you inadvertently be setting existing connections to new connections, causing the system to freak out?
我怀疑这是一个网络问题,或者你可能会在前20个客户端连接时看到它发生。只是在黑暗中拍摄,但你如何处理这些连接?你在使用某种数组或集合吗?您是否可能无意中将现有连接设置为新连接,导致系统崩溃?