0

My application (WIN32-Delphi-SecureBridge) creates an SSH tunnel to a PostgreSQL database. Sometimes the tunnel is not closed properly and a process is left which I cannot remove programmatically. Below is a screenshot of what it looks like when I want to kill the process. How can I otherwise clear port 5002?

NETSTAT lists process 2876 but TASKKILL doesn't find that PID

AmigoJack
  • 5,234
  • 1
  • 15
  • 31
Olaf
  • 215
  • 2
  • 14
  • After `taskkill` says it can't find the process, if you run `netstat` again, do you still see the same process? The OS doesn't lie about not being able to find a process. – Remy Lebeau Feb 28 '22 at 19:20
  • Yes, netstat sees it all the time. (see, I've replaced the screenshot) – Olaf Feb 28 '22 at 19:28
  • 1
    And, if you go into Task Manager, do you see PID 2876 on the list? Maybe `netstat` is reporting a stale connection from a dead process? – Remy Lebeau Feb 28 '22 at 20:41
  • No, in Task Manager i don't see this PID number – Olaf Feb 28 '22 at 23:09
  • 1
    Well, then `taskkill` is telling the truth when it says the process doesn't exist, and `netstat` (or the underlying OS routing tables) has a bug causing stale data to be left behind. – Remy Lebeau Feb 28 '22 at 23:24

0 Answers0