如何在Linux上断开任意TCP/IP连接? [英] How do I break an arbitrary TCP/IP connection on Linux?
问题描述
是否存在任何可用于从某些程序断开现有TCP/IP连接的命令?
Is there any command that can be used to break an existing TCP/IP connection from some program?
操作系统知道TCP连接中是否存在任何内容,或者操作系统仅看到本地套接字上的TCP传输并且不知道哪个请求服务于哪个套接字?
Is there anything in a TCP connection the OS is aware of, or do the OS only see TCP transfer on local sockets and doensn't know which request is served to which socket?
例如,如果Firefox将请求发送到某个服务器的端口80并正在等待答案.然后可以找到Firefox侦听端口并诱使Firefox显示ERR_CONNECTION_REFUSED
或类似内容.
For example, if Firefox sends a request to some server's port 80 and is waiting for the answer. Is it possible then to find Firefox listening port and trick Firefox into showing ERR_CONNECTION_REFUSED
or something similar.
我想要一个不会阻止数据流并让应用程序以这种方式处理这种情况的解决方案,而是关闭套接字或TCP/IP连接(这应该是可能的,因为套接字是操作系统所必需的)是我认为的原因吗?连接还是OS属性还是应用程序所做的事情?),因此应用程序会立即做出反应.
I would like a solution that does not prevent the data flow and lets the application handle this situation in its way, but rather close the socket or the TCP/IP connection (which should be possible as the socket is something the OS is responsible for I think? Is the connection also a OS property or just something the application does?) so the application would react immediately.
推荐答案
使用 tcpkill .
这篇关于如何在Linux上断开任意TCP/IP连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!