Get struct from TCP socket
Hi, im working with Rama's TCP code. But I want to transfer a struct which is the same for client and server. How to do it?
where str_data is the struct. It has a size of 72 bytes. But how do I get it in unreal? Seems like the Recv only returns uint8 pointer. How to get the struct out of it? Any static_cast, reinterpret_cast seems to fail.
It looks like this
Any ideas how to solve it? Thanks a lot! L
asked May 28 '18 at 11:17 AM in C++ Programming
Hi, you can't simply cast to the struct you want, instead, you must read data and interpret to a struct yourself. You should also keep in mind the endianness of the data you send.
answered May 28 '18 at 11:59 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here