S
SethInMI
I am a total newb at .net, and I have not been able to search out a best
practice answer to what must be a common problem.
My app must process binary data from a UDP socket, a MSMQ queue and a file.
In C, the data is in nested structs, with mixed types, floats, ints, char
arrays, int arrays, variable length arrays of structs etc.
My preference would be to access the data in a similar fashion to C, casting
the byte array of received data to the struct I want, and then sending out
the struct when it is time to transmit.
How can I format a struct to be able to mimic legacy structs, especially
with arrays? I see how I can do it for marshalled code, with [ MarshalAs(
UnmanagedType.ByValArray, SizeConst=XX )] attribute, but does that only work
with unmanaged code?
Thanks,
Seth
practice answer to what must be a common problem.
My app must process binary data from a UDP socket, a MSMQ queue and a file.
In C, the data is in nested structs, with mixed types, floats, ints, char
arrays, int arrays, variable length arrays of structs etc.
My preference would be to access the data in a similar fashion to C, casting
the byte array of received data to the struct I want, and then sending out
the struct when it is time to transmit.
How can I format a struct to be able to mimic legacy structs, especially
with arrays? I see how I can do it for marshalled code, with [ MarshalAs(
UnmanagedType.ByValArray, SizeConst=XX )] attribute, but does that only work
with unmanaged code?
Thanks,
Seth