mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 17:28:29 +00:00
Fix #179
This commit is contained in:
parent
0b2c506ca4
commit
2aa35d5f53
1 changed files with 3 additions and 0 deletions
|
@ -659,6 +659,9 @@ socket_t create_socket(const char *host, int port, Fn fn,
|
||||||
// Make 'reuse address' option available
|
// Make 'reuse address' option available
|
||||||
int yes = 1;
|
int yes = 1;
|
||||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes));
|
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
|
// bind or connect
|
||||||
if (fn(sock, *rp)) {
|
if (fn(sock, *rp)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue