views:

164

answers:

2

How can I disconnect any process from the Internet? PID process and IP (local / remote) are known.

+2  A: 

It sounds like you want to control which applications can access the network/Internet.

If you just want to pick and choose which applications can have network access or which protocols you want to be used, I recommend any free or commercial firewall product.

If you need more control, such as disconnecting existing connections for a given process/protocol, I don't know of a simple API call. It would mean more effort, but you could use a local proxy server written in Delphi. If applications use this proxy to get to the outside world, you can add the ability to disconnect specific connections.

Bruce McGee
A: 

You could kill the process itself, or disconnect the network card from the network (the later would effect all processes on the machine though). AFIK most current software firewalls do not allow apply rule changes to existing connections, just when new connections are requested.

skamradt