[Y-devel] Proposal: message structure change

Alexey Boyko smartly at gala.net
Sat Feb 28 08:24:47 GMT 2004


> > May be this suggestion you like: all Y datagrams is array of uint32_t. On
> > reception, entire array is converted with ntohl, and then processed.
>
> How about sending it in the endianness of the sender and make the
> endianness known (either during handshake or in the first byte of a
> packet)?
> That way you always do minimal reordering.

Checking endianess before convertion, may be the same, as doing conversion. 
And Mark already use htonl/ntohl conversion in message header.

But for handshake, i think, better pass first word like 0x000000FF. If we read 
0x000000FF - endianness matches, if 0xFF000000 - endianess differ, and we 
must swap bytes.




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved