Address already in use: bind code example
Example 1: address already in use :::3001
lsof -i tcp:3001
kill -9 {PID}
Example 2: address already in use
# To see ports in use
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
Example 3: address already in use :::8081 windows
netstat -a -n -o
//then find the pid which is running in this port and run
taskkill /F /PID [pidnumber]
Example 4: address already in use
comSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)