| 258 | } |
| 259 | |
| 260 | static int anetSetReuseAddr(char *err, int fd) { |
| 261 | int yes = 1; |
| 262 | /* Make sure connection-intensive things like the redis benchmark |
| 263 | * will be able to close/open sockets a zillion of times */ |
| 264 | if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) { |
| 265 | anetSetError(err, "setsockopt SO_REUSEADDR: %s", strerror(errno)); |
| 266 | return ANET_ERR; |
| 267 | } |
| 268 | return ANET_OK; |
| 269 | } |
| 270 | |
| 271 | static int anetCreateSocket(char *err, int domain) { |
| 272 | int s; |
no test coverage detected