i not sure what OS is it but from what i gather is the following.
All numbers are represented in the little-endian
format. Between the data-type is no alignment
present. Little endian is a storage mechanism
where the least significant byte is stored on the
lowest address, followed by the more significant
bytes. E.g. a WORD is represented in memory
as two consecutive bytes where the LSB is
stored on the lowest address and the MSB on
the next address. For transmission over TCP, the
LSB byte is transmitted first, followed by the
MSB bytes
So i believe it is pretty much like windows OS?
The problem i am facing is converting the struct to byte array so i can send it over sockets via vb.net.
Any hellp here?
Main Topics
Browse All Topics





by: KdoPosted on 2009-08-24 at 12:10:44ID: 25171391
Hi jaxrpc,
For sending data to a server, the client program has absolutely no knowledge (or need to know) what language was used to write the server code. Data is data, no matter where it comes from or goes. From your question/sample, the only thing that we can really do with these C structs is to use them as a model for the data buffer.
Unfortunately, we need to know the operating system where these structures are defined. Objects can change sizes between systems. But, if we assume a 32-bit Windows operating system (most likely) we can define a workable buffer.
Check the comments in the code below. They should give you a hint as to what the objects look like.
And note that you might have to pack/unpack a buffer in VB to pass it on the network. That's beyond my ability to help here.
Good Luck,
Kent
Select allOpen in new window