Linux denies socket connection permission with boost asio

I have a problem with binding to a socket, and I get permission when I run the program as a user. this line of code generates an error.

_acceptor = new boost::asio::ip::tcp::acceptor(io, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), serverPort)); mistake

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'

what (): bind: Permission denied

However, if I run it as root, it works fine. I tried disabling apparmor and firewall using

sudo service apparmor stop
sudo ufw disable

but i still have a problem. Am I missing something that may deny permission? I would really like to find out, since I do not like to run my IDE and unproven program as root.

I am running xubuntu 13.10 with all updates installed.

+4
source share
1 answer

Unix 1024 root, , serverPort < 1024 - > 1024

+8

All Articles