> > > > Because sockets are big endian, not little endian as the CPU. I think you > > have to use READ to decode the messages as soon as you receive them. > > > > If you want to process them later, you can use a Variant[] to store the > > decoded data instead of a String storing the undecoded data. > > I don't know what to say. The endianness should automatically be > decoded; I thought was the whole point of removing the Mk*$() functions. > > A transaction can be something like, "Okay, good job" or an entire clip > of the world terrain in dozens of blocks. It can't just be stored in an > array as a Variant. > > What do the string values mean? Are they reversed and/or inverted bits? > If I can flip the bits I can get back to work.
When you write the data to the socket, all data are converted from the CPU endianness (little endian for Intel/AMD) to the network endianness (big endian by definition). When you read the data from the socket, the data must be converted back from big endian to little endian, and it is done automatically by READ. But if you read everything inside a string, that is not done, because string are bytes, and so do not have endianness. Do you have an example of code that takes the socket data from a big message like you described and decode it? We will find a solution! -- Benoît Minisini ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user