Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

boost asio unable to run examples

Posted on 2008-10-13
5
Medium Priority
?
708 Views
Last Modified: 2008-10-30
Hi All,

I tried the following examples:
http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/tutorial.html
by creating a simple synchronous tcpip server and a simple tcpip client and running them on Sun Solaris 5.10,
So I run the server but each time I run the client and try to connect I got "connection refused message"
Please provide any help.

Thanks,

B.T
0
Comment
Question by:bachra04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 22709678
Can you show the exact code you used ? (there are multiple code samples on that site - which did you use, and how did you modify it ?)

Are you running the client and the server on the same machine ? Or on different machines ?

Do you have any firewall installed ?
0
 
LVL 2

Author Comment

by:bachra04
ID: 22710693
Actually this part of code is not working

tcp::resolver::query query(boost::asio::ip::host_name(), "daytime");  
// resolve the query
endpoint_iterator = resolver.resolve(query);

Once I removed that everything works fine, so it has something to do with name resolution.
It has sthg to do with name/ address resolution.
By the way I'm running both client and server on the same machine.
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22710936
what if you use "localhost" instead of boost::asio::ip::host_name() ?
0
 
LVL 2

Author Comment

by:bachra04
ID: 22717347
I did but without success
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 1500 total points
ID: 22718857
As I asked earlier, can you show the exact code you are using, as well as the output you get from both server and client ?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question