Closed ravellan closed 3 years ago
I have to ask where you think this might be used? The hconn is only ever changed after a connect or disconnect. So it can't be used, for example, to check that a client connection is still alive just before an MQPUT.
It goes along the lines that a connection is shared by multiple goroutines and one of them might respond to a connection broken with a disconnect and then create a new one. This could of course be handled in different ways but I thought it would be convenient to check if a conn has been disconnected and if so get a new one in the other routine before using it. If this doesn't sound like a good practice I'm fine with rejecting this.
I think I am going to decline this one. It's not how MQ apps are normally expected to work - it would be more normal to set the variable to nil (or something like that) after doing a disconnect in the application.
Please ensure all items are complete before opening.
What
Added an
IsValid
method to theMQQueueManager
typeHow
Since the underlying hConn in
MQQueueManager
is not exported a convenience method is added to check if the hConn is still valid or has been set toMQHC_UNUSABLE_HCONN
Testing
Test is added in package test suite.
Issues
N/A