Ignore:
Timestamp:
Sep 22, 2020, 11:29:12 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/worker.cfa

    r1c507eb r7a80113  
    2828        CONNECTION:
    2929        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                }
    3235
    3336                printf("New connection %d, waiting for requests\n", fd);
     
    8285        }
    8386}
    84 
    85 //=============================================================================================
    86 // Acceptor Thread
    87 //=============================================================================================
    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.