LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Restrictions when sending cluster over tcp/ip

What are the restrictions when sending cluster data over tcp/ip. Can I send (string, string, int, double, array of boolean) as cluster over tcp/ip?. I attached Client Server Vis so you can look at it. I know STM library and it works for that kind of cases but I dont want STM library. I want pure TCP/IP and I want to send whatever cluster I want over tcp/ip.

 

...Ok I edited message. Moderator can delete message.

0 Kudos
Message 1 of 2
(2,983 Views)

The only real restriction is that the reciever needs to know how many bytes to read to get the full message.  This is especially true due to the strings in the cluster.  So what is normally done (you will see this inside of the STM library) is to get the length of the flattened string, flatten that numberic (I32) to a string.  Send the length string and then send the cluster data.  Then the reciever read the first 4 bytes to get the length.  Unflatten that to the I32 and read that number of bytes.  You can then unflatten that string correctly into your cluster.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(2,970 Views)