It's a pretty basic client-server application. The server just listens
for a connection, authenticates the client, and then does a reboot. It
avoids the following to get added reliability:
It doesn't use any existing client-server application, because
then it would have the same problem as that application.
It doesn't go through init for the reboot - it just issues
a reboot system call
It doesn't sync the disks (some would say this is risky, though
with journaling filesystems it's less so than it used to be. Also
it's easy to change it to sync if you prefer that)
It doesn't fork - it does its job entirely in a single process
It doesn't exec - it does its job entirely in a single process
It doesn't use virtual memory. It only uses physical memory.
It gets this advantage via mlockall on most machines.
It doesn't piggyback on /bin/login or sshd or telnetd or anything like
that, because that would decrease the effectiveness of the program.