close all localhost connections

Shell
netstat -ano | findstr :yourPortNumber

taskkill /PID typeyourPIDhere /F
Source

Also in Shell: