windows close the port code example
Example: how to shutdown port in windows
netstat -ano | findstr < Port Number >
taskkill /F /PID < Process Id >
netstat -ano | findstr < Port Number >
taskkill /F /PID < Process Id >