473,563 Members | 2,797 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_ser vice, tcp::endpoint(t cp::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 7149
On Apr 19, 3:04 pm, "wo3...@gmail.c om" <wo3...@gmail.c omwrote:
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_ser vice, tcp::endpoint(t cp::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
1926
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 these DLL interoperate with managed code. Among others things, the managed code need to be able to register for notification with the boost signals....
0
1005
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 std::cout; using std::endl; #include <boost/signal.hpp> #include <functional>
1
12733
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, Boost 1.33.1,
3
2663
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 following: private: signal<void()x; public: void connectX(const signal<void()>::slot_type& slot); void disconnectX(const...
1
1311
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 code that i suspect it is bad and slowing the performance and rising the time to select database rows. function...
1
4227
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 = boost::asio::read_until(*comm_socket, response, delimiter); The problem is, the bytes i get back are correct except it strips out all the 0x11 characters. I have...
0
1652
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., unplugged from the net), it takes some time until the completion handler is called with error. In my old code that uses select with non-blocking windows...
167
8205
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 object should run in its own thread, it should implement this mix-in class. Does this sound like plausible design decision? I'm surprised that C++...
6
13837
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 std::list<intList_t; // default allocator //typedef std::list<int, boost::pool_allocator<int List_t;
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6255
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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 we have to send another system
1
1200
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.