Ignore:
Timestamp:
Jul 16, 2020, 2:56:45 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
79306383
Parents:
0aec496
Message:

Added support for argument parsing.
Removed unnecessary headers.
Fixed magic number in splice.

File:
1 edited

Legend:

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

    r0aec496 r7f389a5c  
    77extern "C" {
    88        #include <sys/socket.h>
    9         #include <sys/types.h>
    109        #include <netinet/in.h>
    1110}
     
    1817#include "filecache.hfa"
    1918#include "options.hfa"
     19#include "parseargs.hfa"
    2020#include "worker.hfa"
    2121
     
    5757int main( int argc, char * argv[] ) {
    5858        int port      = 8080;
    59         int ret       = 0;
    6059        int backlog   = 10;
    6160        int nprocs    = 1;
     
    6665        //===================
    6766        // Parse args
     67        static cfa_option opt[] = {
     68                {'p', "port", "Port the server will listen on", port},
     69                {'c', "cpus", "Number of processors to use", nprocs},
     70                {'t', "threads", "Number of worker threads to use", nworkers},
     71                {'b', "accept-backlog", "Maximum number of pending accepts", backlog},
     72                {'B', "channel-size", "Maximum number of accepted connection pending", chan_size}
     73        };
     74        int opt_cnt = sizeof(opt) / sizeof(cfa_option);
     75
     76        char **left;
     77      parse_args( argc, argv, opt, opt_cnt, "[OPTIONS] [PATH]  -- cforall http server", left );
     78
    6879
    6980        //===================
     
    8091        }
    8192
     93        int ret = 0;
    8294        struct sockaddr_in address;
    8395        int addrlen = sizeof(address);
Note: See TracChangeset for help on using the changeset viewer.