Corral the last setsockopt() call into one place.

This commit is contained in:
Ian Gulliver
2016-02-28 12:34:43 -08:00
parent 9e591904ac
commit 161ea56d45
3 changed files with 7 additions and 2 deletions

View File

@@ -7,6 +7,11 @@
#include "socket.h"
void socket_pre_bind_init(int fd) {
int optval = 1;
assert(!setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)));
}
void socket_bound_init(int fd) {
int qlen = 5;
assert(!setsockopt(fd, SOL_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen)));