LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do methods “travel” the wires with objects?

I wish I had my computer with me to try something but to be honest it would probably take a long time for me to set up a test.

 

if I have a client/server scenario where the clients inherit an interface/parent class for certain “universal” command set, and the client also has some specific things to add on to that, can the client send its object (inherited from the provided interface/class) to the server (over tcp) and on the server side this object is piped into the interface/parent dynamic dispatch vi and the client/child method “magically” is called? In other words, does the method travel on the wires? Or…. would the server need to have already a copy on local disk of this child class to reference and call the child method?

 

My intuition tells me it is the latter scenario but the former (methods travel with objects) would be pretty eye opening for me.

0 Kudos
Message 1 of 3
(712 Views)

To send an object over TCP, it would need to be flattened first to string - flattened objects contain the private data (including ancestors), reference to the class name (as namespaced) and other versioning data - but not the VI members of that class (source - https://lavag.org/topic/7901-flattened-lvoop-class/).

 

So I would suggest the latter option (files on server - class, including ancestors, and members - of the correct versions) would be required to unflatten the object.

0 Kudos
Message 2 of 3
(703 Views)

As tyk says. Flattening only transfers the actual data not the wire datatype. That part is described in the separate typedescriptor and for performance reason not normally transferred except when code is actually deployed.

 

Trying to do that yourself would be a major investment and almost not worth the trouble, and especially in the runtime likely not possible without major hackery.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(667 Views)