From 2aa35d5f537d43064445ed7277452420946df57e Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 28 Jun 2019 12:08:47 -0400 Subject: [PATCH] Fix #179 --- httplib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httplib.h b/httplib.h index bb597cb..1215ab2 100644 --- a/httplib.h +++ b/httplib.h @@ -659,6 +659,9 @@ socket_t create_socket(const char *host, int port, Fn fn, // Make 'reuse address' option available int yes = 1; setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)); +#ifdef SO_REUSEPORT + setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (char *)&yes, sizeof(yes)); +#endif // bind or connect if (fn(sock, *rp)) {