1) Is it ok to reuse the connection object (i.e. open => close => open)?
Should be; the state is all in ConnectionImpl of which a new instance
is created on open().
Hi Gordon,
I had an issue in reusing the connection object as Ted has explained. I
raised this on the dev list some time back.
Its like this. In case the connection can not be established to the
broker, you can not call connection.open again without calling
connection.close in side the exception block. Simply it does not
connect even if the broker comes up again.
i.e.
while (true)
{
try
{
connection.open(ip, port);
}
catch (exception& e)
{
connection.close();
}
}
Danushka