toffaletti/libten — pull request #69 by chipdude (2013-03-29 04:36:22+00:00)
Title: use shutdown() to stop netsock_server; set async socket errno; etc.

the shutdown() approach seems perfect.
setting errno after epoll_wait() is just a matter of a getsockopt().
which led me to tidy up the getsockopt, setsockopt, and fcntl interfaces a tad.