adds fast open support in server

This commit is contained in:
clowwindy
2014-05-02 14:56:53 +08:00
committed by clowwindy
parent 666e46bb1d
commit 9da787a5ef
+4
View File
@@ -92,6 +92,10 @@ int create_and_bind(const char *host, const char *port)
#ifdef SO_NOSIGPIPE
setsockopt(listen_sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
#endif
#ifdef TCP_FASTOPEN
opt = 5;
setsockopt(listen_sock, SOL_TCP, TCP_FASTOPEN, &opt, sizeof(opt));
#endif
s = bind(listen_sock, rp->ai_addr, rp->ai_addrlen);
if (s == 0)