Just an idea popping up in my mind: firewall?

 

Regards,

Nicola

 

From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Grotjahn Clemens (CM-AI/PJ-CF22)
Sent: Donnerstag, 14. Januar 2010 13:46
To: boost-users@lists.boost.org
Subject: [Boost-users] [asio] asio-client only connects to server when on same machine

 

hi everybody,

 

i have an issue with my asio-client that wants to connect to

an asio-server. when i set my server on a machine in our

network to listening on a port (>1024) and then try to connect

with my client via this port, i get a "Connection refused"-exception.

this happens every time the server and client are located on different

machines. if i try this on the same machine it works fine!

also, if i try to connect via telnet from another machine it works!

 

here's the client-setup-code snippet, maybe i missed a special config there?:

   tcp::resolver resolver( _io ); //_io is class-member

   tcp::resolver::query query( server, port ); //server and port are char-buffers

   tcp::resolver::iterator iter = resolver.resolve( query );

   _socket = new tcp::socket( _io );

   tcp::resolver::iterator end; // End marker.

   boost::system::error_code error = error::host_not_found;

   while (error && iter != end)

   {

      _socket->close();

      _socket->connect(*iter++, error);

   }

   if (error)

      throw boost::system::system_error( error );

   }

   catch( std::exception& e )

   {

      cout << "NetClient Konstruktor: " << e.what() << endl;

   }

 

 


-- 
Visit us at

FOE 2010 / January 20-22 / Tokyo Big Sight, Japan / East Hall 2-30
http://www.foe.jp/en/

Photonics West 2010 / January 23-28 / The Moscone Center, San Francisco, CA / Booth 4601-32
http://spie.org/photonics-west.xml