473,505 Members | 13,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7128
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1915
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
0
995
by: Arnaud Debaene | last post by:
Could someone explain why the following code works when compiled without /clr but fails at runtime with a boost::bad_function_call exception when compiled with /clr? #include <iostream> using...
1
12730
by: 张沈鹏 | last post by:
How to compile the HelloWorld of boost.asio? Maybe this is a stupid problem , but I really don't konw how to find the right way. My compile environment is WinXP, Msys , MinGw , G++ 3.4.2,...
3
2657
by: Memfis | last post by:
What is the best practice for using boost::signal? Should the signal be a public field? Should an accessor method be used? Should there be some special connection methods for every signal, like the...
1
1308
by: megotronx | last post by:
hello.i`m newbie in php and i need to boost performance of searching in database.I don`t know is it the mssql problem or php script for accsesing database.So i`m looking for help here.Here is the...
1
4214
by: bje990 | last post by:
Here is the situation.... I have a device i connect to where i read a byte stream until some delimiter is found. boost::asio::streambuf response; size_t length =...
0
1643
by: iwr | last post by:
Hello, I'm moving parts of some windows socket-based code to boost.asio. My async socket is connected to a server, and I noticed, that when the server goes down in a "non-graceful" way (eg.,...
167
8156
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
6
13831
by: Juha Nieminen | last post by:
I tested the speed of a simple program like this: //------------------------------------------------------------ #include <list> #include <boost/pool/pool_alloc.hpp> int main() { typedef...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.