Changeset 12585 for trunk/FACT++/dim/src/examples
- Timestamp:
- 11/21/11 09:02:21 (14 years ago)
- Location:
- trunk/FACT++/dim/src/examples
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/examples/test_client.c
r11881 r12585 65 65 { 66 66 char *format; 67 67 /* 68 68 format = dic_get_format(0); 69 69 printf("Received format = %s %08x, %d\n",format, format, *size); 70 */ 70 71 if(*tag == 1100) 71 72 { … … 94 95 } 95 96 else 96 printf("%s Received %s %08X for Service%03d\n",client_str,buf,buf,*tag);97 printf("%s Received %s for Service%03d\n",client_str,buf,*tag); 97 98 98 99 /* … … 124 125 { 125 126 sprintf(str,"%s/Service_%03d",argv[2],i); 126 // dic_info_service( str, TIMED, 10, 0, 0, rout, i,127 // "No Link", 8 );128 127 dic_info_service( str, TIMED, 10, 0, 0, rout, i, 129 NULL, 0);128 "No Link", 8 ); 130 129 } 131 130 -
trunk/FACT++/dim/src/examples/test_server.c
r11121 r12585 28 28 29 29 if(tag){} 30 dim_print_date_time(); 30 31 printf("Command received, size = %d, TT size = %d:\n", *size, 31 32 (int)sizeof(TT)); … … 70 71 char extra_dns[128]; 71 72 int new_dns = 0; 73 int index = 0; 72 74 /* 73 75 int buf_sz, buf_sz1; … … 156 158 while(1) 157 159 { 160 index++; 158 161 /* 159 162 for(i = 0; i < 20; i++) -
trunk/FACT++/dim/src/examples/test_server.cxx
r11881 r12585 1 //============================================================================2 // Name : emptyDimFormat.cpp3 // Author : Etienne Lyard etienne.lyard@unige.ch4 // Version : 005 // Copyright :6 // Description : Demonstrates the occurence of an empty Dim format from the client's perspective7 //============================================================================8 /*9 #include <dic.hxx>10 #include <dis.hxx>11 #include <iostream>12 using namespace std;13 14 class EmptyServiceSubscriber : public DimInfo15 {16 DimStampedInfo* info;17 int noLink;18 public:19 EmptyServiceSubscriber()20 {21 // info = new DimStampedInfo("TIME/EMPTY", const_cast<char*>(""), this);22 noLink = -1;23 info = new DimStampedInfo("TIME/EMPTY", noLink, this);24 }25 void infoHandler()26 {27 DimInfo* I = getInfo();28 int data;29 if (I == info)30 {31 data = I->getInt();32 // cout << "EMPTY SERVICE UPDATED. " << "Format: " << I->getFormat() << endl;33 cout << "EMPTY SERVICE UPDATED. " << data << " Format: " << I->getFormat() << endl;34 }35 }36 };37 38 int main(int, const char**)39 {40 DimServer::start("TIME");41 42 int emptyFormatVariable = 0;43 DimService* emptyFormatService = new DimService("TIME/EMPTY", "I:1", &emptyFormatVariable, sizeof(long));44 EmptyServiceSubscriber mySubscriber;45 //The three lines below create (most of the time) an empty format on the client side.46 //We must be able to deal with such cases in our framework because services can be stopped and re-spawned at any time47 delete emptyFormatService;48 usleep(1000000);49 emptyFormatService = new DimService("TIME/EMPTY", "I:1", &emptyFormatVariable, sizeof(long));50 51 while (1)52 {53 emptyFormatService->updateService();54 usleep(1000000);55 }56 57 return 0;58 }59 */60 61 1 #include <iostream> 62 2 #include <dis.hxx>
Note:
See TracChangeset
for help on using the changeset viewer.