#include <sys/socket.h>
#include <netdb.h>
#include <poll.h>
+#include <signal.h>
#include <errno.h>
#include <vector>
#include <string>
{
should_stop = true;
+ pthread_kill(worker_thread, SIGHUP);
if (pthread_join(worker_thread, NULL) == -1) {
perror("pthread_join");
exit(1);
pfd.events |= POLLRDHUP;
int nfds = poll(&pfd, 1, 50);
- if (nfds == 0 || (nfds == -1 && errno == EAGAIN)) {
+ if (nfds == 0 || (nfds == -1 && errno == EINTR)) {
continue;
}
if (nfds == -1) {