Hi Chris,

This is a known problem, fixed since 0.6. Please see:
https://issues.apache.org/jira/browse/QPID-2558

If you can possibly use the current development sources, the problem is
fixed there.

Best regards,
-Steve

--
Steve Huston, Riverace Corporation
Total Lifecycle Support for Your Networked Applications
http://www.riverace.com


> -----Original Message-----
> From: Chris Howard [mailto:[email protected]] 
> Sent: Tuesday, July 20, 2010 4:04 AM
> To: [email protected]
> Subject: C++ client crashes if it is unable to connect to the broker
> 
> 
>   Hi,
> 
> I have a very simple C++ program that attempts to connect to a broker 
> running on localhost:
> 
> #include "qpid/messaging/Connection.h"
> #include <iostream>
> 
> using namespace std;
> 
> int main(int argc, char* argv[])
> {
>      try
>      {
>          qpid::messaging::Connection connection = 
> qpid::messaging::Connection::open("amqp:tcp:localhost:5672");
>          connection.close();
>      }
>      catch (qpid::Exception& e)
>      {
>          cout << e.what() << endl;
>      }
> }
> 
> However, if the broker is not running, then the program 
> crashes during 
> the call to Connection::open, rather than throwing a 
> ConnectionException.
> 
> I see the following output:
> 
> 2010-07-20 08:45:46 warning Connecting failed: No connection could be 
> made because the target machine actively refused it. :  
> (..\..\..\..\cpp\src\qpid\sys\windows\Socket.cpp:219)
> 2010-07-20 08:45:46 warning Connection closed
> Press any key to continue . . .
> 
> I also see similar behaviour (in a more complicated program) if the 
> broker is closed while a session is in progress.
> I am using qpid 0.6 and I am running on Windows Vista. Am I doing 
> something wrong?
> 
> Regards,
> Chris
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:[email protected]
> 
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to