06-04-2024 07:24 AM
Hello,
I have a TCP communication problem with a host.
I can easily connect to the host which tells me it is a Little Endian (int HostIsLittleEndian (void);).
The problem is that the client specification asks me for the telegram size to be in Big Endian.
Can anyone help me solve this problem?
Solved! Go to Solution.
06-05-2024 02:09 AM
I may guess that what you are to accomodate is not the header of the raw TCP message, which is a lot more complex and is automatically handled by the OS, but rather the data field of the message itself, into which you must incapsulate that value as part of the device specific protocol. If this is true, then you can use an appropriate ToXXXEndian () CVI function to accomodate the header in the format required from the host you are communicating with.
06-05-2024 02:28 AM
Ciao Roberto,
Thank you for the suggestion. You're right, I just need to add the big endian length into the buffer that is sent.
I was getting lost in a glass of water.
Grazie per il lavoro che fai su questo forum.
Ciao
Mattia