Question about openWithProperties


Tom Doust
 

Hi

 

We have just come across this little oddity and wonder if anyone can throw any light on what is supposed to be happening

 

I notice from the source to the C# implementation of Open Mama 2.3.0, that the following code:

        public static void open ()
        {       
            initGetVersionWrapper();
            MamaWrapper.CheckResultCode(NativeMethods.mama_open());
            Interlocked.Increment(ref mMamaopen);
        }

increments the mMamaopen flag, whereas the code:

        public static void openWithProperties (string path, string filename)
        {
            initGetVersionWrapper();
            MamaWrapper.CheckResultCode (NativeMethods.mama_openWithProperties (path, filename));
        }

does not. The transport's destroy() method does nothing unless mMamaopen is non-zero, and that is causing me problems when I try to shutdown an application that uses openWithProperties.  Making an additional call to open() gets round the problem but doesn’t really seem to be the right thing to do. Assuming it is necessary should I expect to call open() before or after openWithProperties()


Has anyone come across this issue?

 

Tom

TOM DOUST | Head of Consultancy                                                                                                         


TICK42

P: +44 (0) 1628 477444 | M: +44 (0) 7710 479924 | E: tom.doust@... | skype:  tom.doust |  http://www.tick42.com  


 

 


Damian Maguire
 

Hey Tom, 

Thanks for raising that, it definitely looks like a bug to me, and the fix seems straight forward. We'd be happy to accept a patch fixing the issue, or you can raise it in Bugzilla and we'll track getting a fix in there.

Cheers, 

Damian


On Thu, Aug 7, 2014 at 10:26 AM, Tom Doust <tom.doust@...> wrote:

Hi

 

We have just come across this little oddity and wonder if anyone can throw any light on what is supposed to be happening

 

I notice from the source to the C# implementation of Open Mama 2.3.0, that the following code:

        public static void open ()
        {       
            initGetVersionWrapper();
            MamaWrapper.CheckResultCode(NativeMethods.mama_open());
            Interlocked.Increment(ref mMamaopen);
        }

increments the mMamaopen flag, whereas the code:

        public static void openWithProperties (string path, string filename)
        {
            initGetVersionWrapper();
            MamaWrapper.CheckResultCode (NativeMethods.mama_openWithProperties (path, filename));
        }

does not. The transport's destroy() method does nothing unless mMamaopen is non-zero, and that is causing me problems when I try to shutdown an application that uses openWithProperties.  Making an additional call to open() gets round the problem but doesn’t really seem to be the right thing to do. Assuming it is necessary should I expect to call open() before or after openWithProperties()


Has anyone come across this issue?

 

Tom

TOM DOUST | Head of Consultancy                                                                                                         


TICK42

P: +44 (0) 1628 477444 | M: +44 (0) 7710 479924 | E: tom.doust@... | skype:  tom.doust |  http://www.tick42.com  


 

 


_______________________________________________
Openmama-dev mailing list
Openmama-dev@...
https://lists.openmama.org/mailman/listinfo/openmama-dev