Interview Prep/Networking/Connectivity: refused, timed out, no route

`bind: Address already in use` when restarting a service.

BeginnerTroubleshootingConnectivity: refused, timed out, no route
Answer

Likely causes → Old process still running, another service owns the port, or the listening socket is lingering and the app doesn't set SO_REUSEADDR.

Diagnose →

sudo ss -ltnp 'sport = :8080'
sudo lsof -i :8080

Fix → Stop the old process or change the port. In your own code set SO_REUSEADDR on listening sockets.

Prevent → Use systemd with proper ExecStop and avoid kill -9, which leaves orphaned children holding sockets.

All Networking questions Roadmap: Networking for DevOps

More on Connectivity: refused, timed out, no route