Non-blocking sockets → safe epoll edge-trigger.

Also some minor attempts to enhance efficiency by output arguments etc.