check service running on port and kill code example
Example 1: kill port
kill -9 $(sudo lsof -t -i:8080)
Example 2: kill port
sudo kill -9 $(sudo lsof -t -i:8080)
Example 3: close all localhost connections
netstat -ano | findstr :yourPortNumber
taskkill /PID typeyourPIDhere /F