Ignore:
Timestamp:
10/18/17 13:54:41 (7 years ago)
Author:
tbretz
Message:
Updated to v20r20 - This also includes some minor fixes, I requested.
Location:
trunk/FACT++/dim/src/examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/dim/src/examples/test_server.c

    r15282 r18920  
    6767        char aux[80];
    6868        char name[84]/*, name1[132]*/;
     69        char srvname[64];
    6970/*
    7071        int on = 0;
     
    9394        printf("result = %d\n", status);
    9495*/
     96        dim_print_date_time();
     97        printf("Dim Server Starting up...\n");
     98        fflush(stdout);
    9599        if(argc){}
    96100        new_dns = dim_get_env_var("EXTRA_DNS_NODE", extra_dns, sizeof(extra_dns));
     
    107111        dis_add_client_exit_handler(client_exited);
    108112
     113        strcpy(srvname, argv[1]);
     114        if(!strcmp(srvname,"xx1"))
     115                strcpy(srvname,"xx");
    109116        for(i = 0; i< 10; i++)
    110117        {
    111                 sprintf(str[i],"%s/Service_%03d",argv[1],i);
     118                sprintf(str[i],"%s/Service_%03d",srvname,i);
    112119                dis_add_service( str[i], "C", str[i], (int)strlen(str[i])+1,
    113120                        (void *)0, 0 );
     
    123130        strcpy(t.str,"hello world");
    124131
    125         sprintf(aux,"%s/TEST_SWAP",argv[1]);
     132        sprintf(aux,"%s/TEST_SWAP",srvname);
    126133        id = dis_add_service( aux, "l:3;d:1;s:1;c:1;s:1;f:1;c:20", &t, sizeof(t),
    127134                (void *)0, 0 );
     135        if(!strcmp(argv[1],"xx1"))
     136        {
     137                sprintf(aux,"%s/TEST_SWAP1",srvname);
     138                id = dis_add_service( aux, "l:3;d:1;s:1;c:1;s:1;f:1;c:20", &t, sizeof(t),
     139                        (void *)0, 0 );
     140        }
    128141        if(id){}
    129         sprintf(aux,"%s/TEST_CMD",argv[1]);
     142        sprintf(aux,"%s/TEST_CMD",srvname);
    130143        dis_add_cmnd(aux,"l:3;d:1;s:1;c:1;s:1;f:1;c:20",cmnd_rout, 0);
    131144
  • trunk/FACT++/dim/src/examples/test_server.cxx

    r18349 r18920  
    137137//      delete dim;
    138138
     139        dis_set_debug_on();
    139140        DimServer::start("TEST");
    140141        extraDns = DimUtil::getEnvVar((char *)"EXTRA_DNS_NODE");
    141142        if(extraDns)
    142                 newDns = new DimServerDns(extraDns, 0, (char *)"new_TEST");
     143                newDns = new DimServerDns(extraDns, 0, (char *)"TEST");
     144//              newDns = new DimServerDns(extraDns, 0, (char *)"new_TEST");
    143145
    144146//      int i, arr[15000];
     
    156158        if(extraDns)
    157159        {
    158                 new_servint = new DimService(newDns, "new_TEST/INTVAL",ival);
     160//              new_servint = new DimService(newDns, "new_TEST/INTVAL",ival);
     161                new_servint = new DimService(newDns, "TEST/new_INTVAL",ival);
    159162        }
    160163
Note: See TracChangeset for help on using the changeset viewer.