Show
Ignore:
Timestamp:
11/21/08 13:34:28 (16 years ago)
Author:
ahe
Message:

minor modification on socket operation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/trnewman/CR_shell/src/main_cognitive_engine.cpp

    r68 r69  
    1515 
    1616struct Utility { 
    17     char name[20]; 
    18     char units[20]; 
    19     char goal[20]; 
     17    char name[50]; 
     18    char units[50]; 
     19    char goal[50]; 
    2020   /* string name; 
    2121    string units; 
     
    3333    /*string name; 
    3434    string units;*/ 
    35     char name[20]; 
    36     char units[20]; 
     35    char name[50]; 
     36    char units[50]; 
    3737    float min; 
    3838    int numAffects;  
     
    4444struct Observable { 
    4545    //string name; 
    46     char name[20]; 
     46    char name[50]; 
    4747    Affect affection_list[10]; 
    4848    int numAffects; 
     
    9090        error("ERROR connecting");*/ 
    9191     
     92    /*// send to server 
    9293    printf("Please enter the message: "); 
    9394    bzero(buffer,256); 
     
    9697    if (n < 0)  
    9798         error("ERROR writing to socket"); 
    98     bzero(buffer,256); 
     99    bzero(buffer,256);*/ 
    99100     
    100101    // read back xml information 
    101     int counter, i; 
     102    int i; 
    102103    Utility * uList[10]; 
    103104    Parameter * pList[10]; 
     
    135136        strcpy(uList[i]->units, buffer); 
    136137 
    137         bzero(buffer,256); 
     138        /*bzero(buffer,256); 
    138139        n = recv(sockfd,buffer,255,0); 
    139140        if (n < 0) 
    140141            error("ERROR reading from socket"); 
    141142        printf("%s ", buffer); 
    142         strcpy(uList[i]->goal, buffer); 
     143        strcpy(uList[i]->goal, buffer);*/ 
    143144         
    144145        /*bzero(buffer,256); 
     
    147148            error("ERROR reading from socket"); 
    148149        printf("%s ", buffer); 
    149         strcpy(uList[i]->target, buffer);*/ 
     150        uList[i]->target, atof(buffer);*/ 
    150151    } 
    151152