I am a developer and I need to run my ruby app at port 5000, but always I try to run my app I get:
Address already in use - bind(2) (Errno::EADDRINUSE)
I know that the easiest way for solving this; is just change the port that I am using for running my app, but I want to know what happens, because every time I execute lsof -i tcp:5000
and kill the process, automatically a new process starts running in that port.
I am using a macbook pro with MacOs Monterrey with version 12.0.1
This happens because Control Center on Monterey listening to port 5000 and port 7000.
For fixing this you need to turn off System Settings > General > AirDrop & Handoff > AirPlay Receiver
.