Changes in benchmark/io/http/main.cfa [7223dbf2:8c43d05]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/main.cfa
r7223dbf2 r8c43d05 10 10 } 11 11 12 #include <fstream.hfa> 12 13 #include <kernel.hfa> 13 14 #include <iofwd.hfa> … … 83 84 //=================== 84 85 // Open Files 85 printf("Filling cache from %s\n", path);86 sout | "Filling cache from" | path; 86 87 fill_cache( path ); 87 88 88 89 //=================== 89 90 // Open Socket 90 printf("%ld : Listening on port %d\n", getpid(), options.socket.port);91 sout | getpid() | ": Listening on port" | options.socket.port; 91 92 int server_fd = socket(AF_INET, SOCK_STREAM, 0); 92 93 if(server_fd < 0) { … … 108 109 if(errno == EADDRINUSE) { 109 110 if(waited == 0) { 110 printf("Waiting for port\n");111 sout | "Waiting for port"; 111 112 } else { 112 printf("\r%d", waited);113 f flush(stdout);113 sout | "\r" | waited | nonl; 114 flush( sout ); 114 115 } 115 116 waited ++; … … 173 174 unpark( workers[i] ); 174 175 } 175 printf("%d workers started on %d processors\n", options.clopts.nworkers, options.clopts.nprocs);176 sout | options.clopts.nworkers | "workers started on" | options.clopts.nprocs | "processors"; 176 177 { 177 178 char buffer[128]; … … 180 181 } 181 182 182 printf("Shutting Down\n"); 183 } 184 183 sout | "Shutdown received"; 184 } 185 186 sout | "Notifying connections"; 185 187 for(i; options.clopts.nworkers) { 186 188 workers[i].done = true; … … 188 190 } 189 191 190 printf("Shutting down socket\n");192 sout | "Shutting down socket"; 191 193 int ret = shutdown( server_fd, SHUT_RD ); 192 194 if( ret < 0 ) { abort( "shutdown error: (%d) %s\n", (int)errno, strerror(errno) ); } … … 194 196 //=================== 195 197 // Close Socket 196 printf("Closing Socket\n");198 sout | "Closing Socket"; 197 199 ret = close( server_fd ); 198 200 if(ret < 0) { 199 201 abort( "close socket error: (%d) %s\n", (int)errno, strerror(errno) ); 200 202 } 203 sout | "Stopping connection threads..." | nonl; 201 204 } 202 printf("Workers Closed\n"); 203 205 sout | "done"; 206 207 sout | "Stopping protocol threads..." | nonl; 204 208 deinit_protocol(); 205 } 206 209 sout | "done"; 210 211 sout | "Stopping processors..." | nonl; 212 } 213 sout | "done"; 214 215 sout | "Closing splice fds..." | nonl; 207 216 for(i; pipe_cnt) { 208 217 ret = close( fds[pipe_off + i] ); … … 212 221 } 213 222 free(fds); 214 215 } 223 sout | "done"; 224 225 sout | "Stopping processors..." | nonl; 226 } 227 sout | "done"; 216 228 217 229 //=================== 218 230 // Close Files 219 printf("Closing Files\n");231 sout | "Closing open files..." | nonl; 220 232 close_cache(); 221 } 233 sout | "done"; 234 }
Note: See TracChangeset
for help on using the changeset viewer.