On Tue, 2010-03-02 at 08:05 -0800, _cristian_ wrote:
> Hello.I have written a simple program that tries to open a connection to a
> qpid broker. 
> I am using qpid 0.5 on Centos5.4 x86_64.
> ...
> The problem is that if the first argument of connection.open is not a valid
> host (for example an ip where there is no qpid broker) the program gets
> stucked in the open() function. 
> This is the gdb backtrace when the host parameter is not valid. The SIGINT
> signal is caused by me pressing CTRL +C .

This is exactly what you would expect, and indeed would be precisely the
behaviour you will get if you opened any TCP connection to a non
existent address [using a normal blocking connect()]

If you need to timeout a connection in progress you should set a
heartbeat timeout on the Connection. use the connections settings to do
this:

ConnectionSettings settings;
settings.heartbeat = 10; // 20 second timeout
settings.host = "host";
settings.username = "user";
settings.password = "password";
connection.open(settings);

That should enable you to timeout an unsuccessful  connection.

Andrew



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

Reply via email to