windows find and kill process on port code example
Example 1: kill service by port number on windows
taskkill /F /PID PORT_NUMBER
Example 2: close all localhost connections
netstat -ano | findstr :yourPortNumber
taskkill /PID typeyourPIDhere /F