The problem with binary over-the-wire is that what with different CPUs having
different ABI conventions for alignment, padding, and byte order, just
writing out a struct won't be portable.

In developing a protocol, that tends to mean people will either go for a
text based format (XML is popular these days, since there are plenty of
parsers, and that would be extensible; but it's not all that efficient, although
unless you're getting hit with million(s) of messages per second, that hardly
matters).  But another approach is to use serialization functions that can
put binary data into a portable form, such as xdr(3).  ONC RPC (on which NFS is 
implemented) uses XDR as its lowest level.

If one is looking strictly at Objective C, there may be a better way; but if
one also wants to communicate using plain old C, well, XDR is pretty common too,
being available on everything that does NFS (OS X, Windows, Linux, *BSD,
Solaris, AIX, ...; not sure about iOS/iPhone OS).  See also RFC 1014 for more
info on XDR.

Unfortunately, it isn't infinitely flexible, so it may not handle an _existing_
binary protocol; but of course it works fine if the protocol is originally
defined in terms of XDR.  I have no idea whether or not one could write an
XDR description that was compatible with the existing Growl UDP protocol.
But it might be worth considering for a future UDP protocol, if that hasn't
already been designed.

-- 
You received this message because you are subscribed to the Google Groups 
"Growl Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/growldiscuss?hl=en.

Reply via email to