Changeset 7a80113 for benchmark/io/http/worker.cfa
- Timestamp:
- Sep 22, 2020, 11:29:12 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0a945fd
- Parents:
- 1c507eb (diff), 08f3ad3 (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/worker.cfa
r1c507eb r7a80113 28 28 CONNECTION: 29 29 for() { 30 int fd = take(wait_connect); 31 if (fd < 0) break; 30 int fd = cfa_accept4( this.[sockfd, addr, addrlen, flags], 0, -1`s, 0p, 0p ); 31 if(fd < 0) { 32 if( errno == ECONNABORTED ) break; 33 abort( "accept error: (%d) %s\n", (int)errno, strerror(errno) ); 34 } 32 35 33 36 printf("New connection %d, waiting for requests\n", fd); … … 82 85 } 83 86 } 84 85 //=============================================================================================86 // Acceptor Thread87 //=============================================================================================88 void ?{}( Acceptor & this, int sockfd, struct sockaddr * addr, socklen_t * addrlen, int flags ) {89 ((thread&)this){ "Acceptor Thread", *options.clopts.instance };90 this.sockfd = sockfd;91 this.addr = addr;92 this.addrlen = addrlen;93 this.flags = flags;94 }95 96 void main( Acceptor & this ) {97 for() {98 int ret = cfa_accept4( this.[sockfd, addr, addrlen, flags] );99 if(ret < 0) {100 if( errno == ECONNABORTED ) break;101 abort( "accept error: (%d) %s\n", (int)errno, strerror(errno) );102 }103 104 printf("New connection accepted\n");105 put( wait_connect, ret );106 }107 }
Note: See TracChangeset
for help on using the changeset viewer.