如何模拟强行关闭TCP连接?TCP

2023-09-03 22:12:27 作者:时光偷走初心

如何让我的测试程序会导致连接被强制关闭,在TCP监听它连接到错误?

How can my test program cause a "connection was forcibly closed" error in the TCP listener it’s connected to?

我的理解是,我不得不关闭而不遵循TCP协议,即不发送FIN数据包的连接。可以这样用一个标准的.NET 插槽 TCP模式做了什么?

My understanding is that I’d have to close the connection without following the TCP protocol, namely without sending a "FIN" packet. Can this be done with a standard .NET Socket in TCP mode?

我似乎能够通过打开多个连接,然后终止该测试程序,但不能以任何其他方式我试图做到这一点。

I seem to be able to do this by opening several connections and then terminating the test program, but not in any other way I’ve tried.

推荐答案

我能够使用工具的 CurrPorts 的。

对于我而言,我试图在一个,是由这个错误引起的第三方SDK测试崩溃。

For my purposes, I was attempting to test a crash within a third-party SDK that was caused by this error.

在管理员模式下运行CurrPorts 点击刷新,当你看到连接。 右键单击,然后关闭所选的TCP连接(或使用CTL-T)