Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sever/kill tcp connection in windows

I would like to see how a program responds when it's connection is severed. Aside from disabling the network card, is there a way to sever a tcp connection in Windows without killing the process, or the thread that owns the connections?

like image 566
Aldur Avatar asked May 05 '09 13:05

Aldur


People also ask

How do I kill a TCP session in Windows?

You can close established TCP/IP connections (those labeled with a state of ESTABLISHED) by selecting File|Close Connections, or by right-clicking on a connection and choosing Close Connections from the resulting context menu. You can save TCPView's output window to a file using the Save menu item.

How do you kill a TCP connection?

Use the DRop/-D command to terminate an individual TCP connection when you do not want to terminate the server itself, but want only to drop an individual connection with that server. Use the DROP/-D command to terminate old TCP connections if they prevent a server from being restarted.


2 Answers

The closest thing that I've found to generating an OS error is to use something like TcpView to look at what sockets are open and sever them. I'm not sure exactly what it does to sever the connection, but it does close it in a way that an application can see.

like image 196
D.Shawley Avatar answered Oct 10 '22 08:10

D.Shawley


TCPView by SysInternals lets you close a connection (and see all open connections).

like image 21
Assaf Lavie Avatar answered Oct 10 '22 08:10

Assaf Lavie