Frase, I just happen to be fooling around in the corresponding code in the python client (adding my own "tcp+ssh" to work over an existing paramiko link). What I would interpret as "registration" (the filling in of qpid.messaging.transports.TRANSPORTS) happens when qpid.messaging.transports is imported (which is protected from happening more than once in python).
I would guess that in C++, and assuming that it was too hard to do as a static initialization, that it probably happens in the constructor of a class that is intended to be a singleton. Perhaps you colleague's code is somehow instantiating that singleton a second time? If you can find the code that prints the message, and you have debug symbols, gdb, a breakpoint, and stack traces may show where he is creating an instance, rather than using the pre-built singleton. Or invoking a class's non-constructor initializing function (or a non-class based initializing function). And not necessarily his bug. Could be an initialization in the session that is performed by both receiver and sender, and not guarded. (I don't remember any restriction about using both on a session, and do so in python, following the example at http://qpid.apache.org/releases/qpid-0.14/books/Programming-In-Apache-Qpid/html/ch02s02.html.) Good luck with that. Bill On Wed, Dec 4, 2013 at 3:11 PM, Fraser Adams <[email protected]>wrote: > Hi all, > a colleague of mine is seeing this message caused by some of his code: > > "[Client] error Tried to register protocol: tcp more than once?" > > TBH I've never seen that one before myself so I'm a bit stumped. I had a > quick Google and came across > http://mail-archives.apache.org/mod_mbox/qpid-commits/ > 200809.mbox/%[email protected]%3E > > So it looks like the message originates from some code that Andrew > implemented a while back > " > > Refactored c++ client library to allow multiple protocols to be > used simultaneously > > " > > I had a quick look through my colleague's code and I couldn't see anything > "obviously" wrong with it although it was using the same session for sender > and receiver, which seemed a bit unusual. > > I don't suppose anyone has a suggestion as to the scenarios that might > cause this error - certainly no obvious explicit "registering" of protocols > seems to have taken place in his code. > > Aside from the sender and receiver using the same session the only other > thing popping though my mind is whether he has put the appropriate #ifndef > protection in his *.h file, not doing that would probably mess with a > static initialiser? > > The code is using qpid::messaging on Qpid 0.18 > > any thoughts? > > Cheers, > Frase > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
