[Nice] complete example

Bryce Allen ballen at ci.uchicago.edu
Thu Jan 31 16:30:34 PST 2013


I expanded my nicetest.c into a complete example, using a simple
serialization format and copying/pasting the data between clients. It's
inspired by icedemo from pjnath, but I didn't find having separate
commands for each phase useful for testing and it made reading the code
more difficult, so I just have three phases:

1) gather candidates, print serialized local data
2) prompt user for remote data, parse and set when entered
3) if successful, prompt for data to send to remote end

I'm probably missing some failure cases and some error checking, but it
seems like it could be a useful addition to the main distribution after
a fixup. I can re-license under LGPL/MPL if needed.

Also please let me know if I'm doing anything fundamentally wrong here.
I'm using pretty much the same flow for a real application, with
condition variables to synchronize instead busy waiting.

Thanks,
Bryce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nicetest.c
Type: text/x-csrc
Size: 13296 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/nice/attachments/20130131/bd4c8662/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/nice/attachments/20130131/bd4c8662/attachment.pgp>


More information about the nice mailing list