Changeset e95a117 for benchmark/io
- Timestamp:
- Jul 20, 2020, 10:23:32 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 289a21c
- Parents:
- 2ecbd7b
- Location:
- benchmark/io/http
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified benchmark/io/http/main.cfa ¶
r2ecbd7b re95a117 100 100 { 101 101 Acceptor acceptor = { server_fd, (struct sockaddr *)&address, (socklen_t*)&addrlen, 0 }; 102 103 char buffer[128]; 104 while(!feof(stdin)) { 105 fgets(buffer, 128, stdin); 106 } 107 108 printf("Shutting Down\n"); 102 109 } 103 printf(" Shutting Down\n");110 printf("Acceptor Closed\n"); 104 111 105 112 // Clean-up the workers … … 108 115 } 109 116 } 117 printf("Workers Closed\n"); 110 118 } 111 119 } -
TabularUnified benchmark/io/http/protocol.cfa ¶
r2ecbd7b re95a117 75 75 for() { 76 76 int ret = cfa_read(fd, it, count); 77 if(ret == 0 ) return [OK200, true, 0p, 0]; 77 78 if(ret < 0 ) { 78 if( errno ) return [OK200, true, 0p, 0];79 79 if( errno == EAGAIN || errno == EWOULDBLOCK) continue READ; 80 80 abort( "read error: (%d) %s\n", (int)errno, strerror(errno) ); -
TabularUnified benchmark/io/http/worker.cfa ¶
r2ecbd7b re95a117 33 33 void main( Worker & this ) { 34 34 CONNECTION: 35 while( int fd = take(wait_connect); fd >= 0) { 36 printf("New connection, waiting for requests\n"); 35 for() { 36 int fd = take(wait_connect); 37 if (fd < 0) break; 38 39 printf("New connection %d, waiting for requests\n", fd); 37 40 REQUEST: 38 41 for() { … … 105 108 } 106 109 107 110 printf("New connection accepted\n"); 108 111 put( wait_connect, ret ); 109 112 } 110 113 }
Note: See TracChangeset
for help on using the changeset viewer.