stop localhost server

C++
netstat -ano | findstr :yourPortNumber
tskill typeyourPIDhere 
Source

Also in C++: