Copying structures to string buffer and back
-
We are using a proprietary string buffer protocol via TCP/IP to transfer string buffers back and forth from the server. In this process, we need to be able to reliably overlay structures onto string buffers and vice versa. The structures can have strings, arrays, chars, dates, numbers as their members. Can someone suggest a reliable way to accomplish this please? soumya
-
We are using a proprietary string buffer protocol via TCP/IP to transfer string buffers back and forth from the server. In this process, we need to be able to reliably overlay structures onto string buffers and vice versa. The structures can have strings, arrays, chars, dates, numbers as their members. Can someone suggest a reliable way to accomplish this please? soumya
I understand from your things that you transfer the string, so u want to translate a structure into a string. one way i think about is to convert the structure into bytes and then decode it back. for each structure you may need some signs, like: 123 mean start to transfer array. 221 mean start one array layer and 122 mean finish transfer the layer. etc.