Eclipse-CDT: How do I handle permission denied errors opening sockets?
-
12-09-2019 - |
Question
My program opens a socket on port 80, but if I don't run it as root (with sudo) then it fails to open the socket with a permission error.
This means my application doesn't work when I launch it in the debugger.
So:
- Can I tell Eclipse-CDT somehow to launch the app using sudo?
- Or, can I somehow enable my program to have permission to open port 80?
thx
- Alex
Solution
For debugging purposes, I'd pass --port 8080
as an argument, or use some other configuration method, and open on 8080. No need for root permissions then.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow