~cs50/pset6/server public and ./server public in my own directory worked fine for a long time but now when I try to run it I get the message "Port 8080 already in use, stopping server."
How can I close port 8080?
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.Sign up to join this community
As far as i can tell you can either use another port than 8080 or better stop the server using that port. The command for the latter is:
This is somehow not written in the pset6 documentation, but in this video you can find the details by David: https://youtu.be/3dmp0ycKC5c
Hope that helps.
that means that some other process is already using the port (likely to be another instance of your
server). terminating/killing that process should make the port available to use.
if this process is not another instance of your
server, you probably should not do that and use some other port which is available. the command to kill a process using port 8080 from the command line is
sudo kill `sudo lsof -t -i:8080`
sudo kill $(sudo lsof -t -i:8080)