boost::asio (Permission denied, Connection refused)

W

wo3kie

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-programming/35804-client-server-progra...

Thanks in advance for help,
Lukasz
 
M

Martin York

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top