Changes in benchmark/io/http/socket.cfa [07997cd:32d1383]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/socket.cfa
r07997cd r32d1383 8 8 #include <sys/socket.h> 9 9 #include <netinet/in.h> 10 #include <netinet/tcp.h> 10 11 } 11 12 … … 33 34 } 34 35 36 int on = 1; 37 const struct linger l = { 1, 0 }; 38 if (setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0) 39 abort( "setsockopt SO_LINGER error: (%d) %s\n", (int)errno, strerror(errno) ); 40 41 if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (const void*)&on, sizeof(on)) < 0) 42 abort( "setsockopt SO_LINGER error: (%d) %s\n", (int)errno, strerror(errno) ); 43 35 44 if(options.socket.reuseport) { 36 int value = 1;37 45 // if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const void*)&on, sizeof(on))) 38 46 // abort( "setsockopt SO_REUSEADDR error: (%d) %s\n", (int)errno, strerror(errno) ); 39 if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, & value, sizeof(int)) < 0)47 if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0) 40 48 abort( "setsockopt SO_REUSEPORT error: (%d) %s\n", (int)errno, strerror(errno) ); 41 49 }
Note: See TracChangeset
for help on using the changeset viewer.