Changeset 18920 for trunk/FACT++/dim/src/examples
- Timestamp:
- 10/18/17 13:54:41 (7 years ago)
- Location:
- trunk/FACT++/dim/src/examples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/examples/test_server.c
r15282 r18920 67 67 char aux[80]; 68 68 char name[84]/*, name1[132]*/; 69 char srvname[64]; 69 70 /* 70 71 int on = 0; … … 93 94 printf("result = %d\n", status); 94 95 */ 96 dim_print_date_time(); 97 printf("Dim Server Starting up...\n"); 98 fflush(stdout); 95 99 if(argc){} 96 100 new_dns = dim_get_env_var("EXTRA_DNS_NODE", extra_dns, sizeof(extra_dns)); … … 107 111 dis_add_client_exit_handler(client_exited); 108 112 113 strcpy(srvname, argv[1]); 114 if(!strcmp(srvname,"xx1")) 115 strcpy(srvname,"xx"); 109 116 for(i = 0; i< 10; i++) 110 117 { 111 sprintf(str[i],"%s/Service_%03d", argv[1],i);118 sprintf(str[i],"%s/Service_%03d",srvname,i); 112 119 dis_add_service( str[i], "C", str[i], (int)strlen(str[i])+1, 113 120 (void *)0, 0 ); … … 123 130 strcpy(t.str,"hello world"); 124 131 125 sprintf(aux,"%s/TEST_SWAP", argv[1]);132 sprintf(aux,"%s/TEST_SWAP",srvname); 126 133 id = dis_add_service( aux, "l:3;d:1;s:1;c:1;s:1;f:1;c:20", &t, sizeof(t), 127 134 (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 } 128 141 if(id){} 129 sprintf(aux,"%s/TEST_CMD", argv[1]);142 sprintf(aux,"%s/TEST_CMD",srvname); 130 143 dis_add_cmnd(aux,"l:3;d:1;s:1;c:1;s:1;f:1;c:20",cmnd_rout, 0); 131 144 -
trunk/FACT++/dim/src/examples/test_server.cxx
r18349 r18920 137 137 // delete dim; 138 138 139 dis_set_debug_on(); 139 140 DimServer::start("TEST"); 140 141 extraDns = DimUtil::getEnvVar((char *)"EXTRA_DNS_NODE"); 141 142 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"); 143 145 144 146 // int i, arr[15000]; … … 156 158 if(extraDns) 157 159 { 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); 159 162 } 160 163
Note:
See TracChangeset
for help on using the changeset viewer.