fixed epoll infinite loop. close on empty read

EOF is a read state, so the epoll_wait loop would loop infinitely since
the socket wasn't closed. fixed print errors by specifiying the number
of bytes in the buffer.

In the future maybe fix some of the weirdness in the enc_msg stuff