how to kill a port in windows 10 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
taskkill /F /PID PORT_NUMBER
netstat -ano | findstr :yourPortNumber
taskkill /PID typeyourPIDhere /F