progrium/duplex — pull request #8 by robxu9 (2014-08-14 16:58:56+00:00)
Title: Add peer drop support

This implements peer drop support. In C, this may have to be modified because we can't close(fd) twice on the fear that the fd will immediately be reused and another connection will be prematurely dropped.

If we read frames and we get EOF, that's okay. If we read frames and it's not EOF, but an actual connection dropping, then we have to call `peer.Drop()` too. I'm unaware if the fd is closed if something goes wrong - see [the POSIX manual](http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html). I THINK I still have to close the fd manually. But... yeah. Needs investigation.

After this PR, I'll investigate peers with same UUIDs.

(aside: so UUID v1s are generated by MAC addresses and nanosecond timing since epoch, IIRC, so... v1 or v4? If no two peers are going to be the same, v4 seems better for fewer collisions.)