Changeset 71cf630 for benchmark/io/http/socket.cfa
- Timestamp:
- Aug 16, 2022, 4:04:47 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- aec2c022
- Parents:
- 741e22c (diff), 17c6edeb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/socket.cfa
r741e22c r71cf630 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.