tags:

views:

29

answers:

1

Hello,

Is there a way to kill off an existing connection??

For example, 192.168.1.120 is connected to be via port 8080.

I would like to know how to terminate that connection?

Many thanks!

+1  A: 

Easiest way (without external software) is to kill and/or restart the process that's watching that port. That'll kill off every connection to that port, though, so it's not something you normally want to do on a server.

To find out which process is handling the connection on your side, you can say netstat -anp in Linux, or netstat -anb in Windows. Note, in Windows, netstat can be quite slow in backtracking from a socket to a process.

If you're using WIndows, and don't mind downloading something, check out SysInternals' TCPView. Lets you see what ports are open, and what's using them. It can even kill connections, IIRC, though i forget whether it's by resetting the connection or killing the process.

cHao