Fix setting SO_REUSEADDR
It expects a boolean, not an address
This commit is contained in:
parent
b5c198ae87
commit
e801ce0c4f
1 changed files with 2 additions and 1 deletions
|
|
@ -104,7 +104,8 @@ int cluster_init()
|
|||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(config->cluster_port);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
setsockopt(cluster_sockfd, SOL_SOCKET, SO_REUSEADDR, &addr, sizeof(addr));
|
||||
opt = 1;
|
||||
setsockopt(cluster_sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||
|
||||
opt = fcntl(cluster_sockfd, F_GETFL, 0);
|
||||
fcntl(cluster_sockfd, F_SETFL, opt | O_NONBLOCK);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue