how to check a port is open code example
Example 1: check if chrome remote port is open
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 -- "%1"
Example 2: how to clear a port in linux
kill -9 $(lsof -t -i:8080)