| 248 | } |
| 249 | |
| 250 | static int anetSetReuseAddr(char *err, int fd) { |
| 251 | int yes = 1; |
| 252 | /* Make sure connection-intensive things like the redis benchmark |
| 253 | * will be able to close/open sockets a zillion of times */ |
| 254 | if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) { |
| 255 | anetSetError(err, "setsockopt SO_REUSEADDR: %s", strerror(errno)); |
| 256 | return ANET_ERR; |
| 257 | } |
| 258 | return ANET_OK; |
| 259 | } |
| 260 | |
| 261 | static int anetSetReusePort(char *err, int fd) { |
| 262 | int yes = 1; |
no test coverage detected