enabling Monitor in C# source code

6 posts / 0 new
Last post
Offline
Last seen: 2 years 6 months ago
Joined: 10/18/2013
Posts: 42
enabling Monitor in C# source code

in C++ i use RTIDefaultMonitor_create as a function pointer to pass to add_property.  what is there in C# to do the same?

Offline
Last seen: 3 years 1 week ago
Joined: 01/15/2013
Posts: 94

Hi Jay,

You can use the static methods in class PropertyQosPolicyHelper ( PropertyQosPolicyHelper.add_property). Is that what you were looking for?

Thanks,

Juanlu

Offline
Last seen: 2 years 6 months ago
Joined: 10/18/2013
Posts: 42

i know of that method.  I am looking for the function pointer that would be passed to that method, or some similar implementation in C#. 

Offline
Last seen: 3 years 1 week ago
Joined: 01/15/2013
Posts: 94

Hi Jay,

There are many ways to change the monitoring library settings, the easiest one being the XML QoS configuration when you're using it from the .NET API, because of the dynamic linking. Is there any specific requirement for you to change it from the code? Recall that the monitoring library property ("rti.monitor.library") is checked when the Domain Participant is created. I don't think it can be changed/enabled afterwards.

Enabling the monitoring library programmatically in C# may be somewhat difficult as the entry-point method is exported as a C function. You would likely need to play with System::IntPtr and [DllImport]s. I have never done this myself.

Would it work for you to have different QoS profiles in your XML configuration, some with monitoring enabled, and choose them appropriately when creating the Domain Participants?

Thanks,

Juanlu

Offline
Last seen: 2 years 6 months ago
Joined: 10/18/2013
Posts: 42

that sounds like the correct solution.  i do not need to change it in code.  i just need to set it up.  we set it up in code in our C++ implementation, and I am following that.  i'll check with the documentation on how to do that or you could provide an example (or link to one).  thank you.

Offline
Last seen: 3 years 1 week ago
Joined: 01/15/2013
Posts: 94

Sure thing! Section 3.1.1 (Method 1 for C# - .NET) in the RTI Monitoring Library Getting Started Guide shows you how to enable it.

Hope this helps,

Juanlu