470,862 Members | 1,825 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

boost::asio (Permission denied, Connection refused)

I had not any issues with Windows, but with Linux I failed

It is going about an example from boost::asio library tutorial
# Daytime.1 - A synchronous TCP daytime client
# Daytime.2 - A synchronous TCP daytime server

After compilation, I changed access settings for files
# chmod a+x server.cpp
# chmod a+x client.cpp

and after I started a program
# ./server

I received an error message like this
# Permission denied

whilst ./client started in second terminal correctly

Fortunately small changed in server.cpp was helpful

# tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 22222 /
*13*/));

from value 13 into 22222 (as an example) (but I do not understand,
what an influance has port number for 'permision denied')

Now both server and client starts correctly
but client just after start receive another error message
# Connection refused

I have found in google issue like this, unfortunately without any
solution
http://www.unix.com/high-level-progr...-server-progra...

Thanks in advance for help,
Lukasz
Jun 27 '08 #1
1 6280
On Apr 19, 3:04 pm, "wo3...@gmail.com" <wo3...@gmail.comwrote:
I had not any issues with Windows, but with Linux I failed

It is going about an example from boost::asio library tutorial
# Daytime.1 - A synchronous TCP daytime client
# Daytime.2 - A synchronous TCP daytime server

After compilation, I changed access settings for files
# chmod a+x server.cpp
# chmod a+x client.cpp

and after I started a program
# ./server

I received an error message like this
# Permission denied

whilst ./client started in second terminal correctly

Fortunately small changed in server.cpp was helpful

# tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 22222 /
*13*/));

from value 13 into 22222 (as an example) (but I do not understand,
what an influance has port number for 'permision denied')

Now both server and client starts correctly
but client just after start receive another error message
# Connection refused

I have found in google issue like this, unfortunately without any
solutionhttp://www.unix.com/high-level-programming/35804-client-server-progra...

Thanks in advance for help,
Lukasz
Off topic for C++
Try a linux group or a group dealing with sockets.

Also note that most OS reserve low port numbers for privileged
accesses (ie root or some equivalent). I am sure you will get more
exact info from a more appropriate group.
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Arnaud Debaene | last post: by
1 post views Thread by 张沈鹏 | last post: by
3 posts views Thread by Memfis | last post: by
1 post views Thread by megotronx | last post: by
6 posts views Thread by Juha Nieminen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.