Changeset 18920 for trunk/FACT++/dim/src/examples/test_server.c
- Timestamp:
- 10/18/17 13:54:41 (7 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.