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_radio.cpp

    r66 r69  
    239239        // Write message back to client 
    240240    n = send(socketfd,message.c_str(),(message.size()+1),MSG_NOSIGNAL); 
     241    if (n<0) 
     242        error("Error sending to client\n"); 
     243    printf("sent: %s\n", message.c_str()); 
    241244         
    242245    return n; 
     
    249252 
    250253     
    251     while(1) { 
     254//    while(1) { 
    252255                // Send parameters from struct 
    253256                sprintf(counter,"%d",ce_info->numUtilities); 
     
    256259                // utilities 
    257260        for(i = 0; i < ce_info->numUtilities; i++) { 
     261        //for(i = 0; i < 1; i++) { 
    258262                        SendMessage(socketfd,uList[i]->name); 
    259263                        SendMessage(socketfd,uList[i]->units); 
     
    263267                } 
    264268 
    265                 // parameters 
     269                /*// parameters 
    266270        sprintf(counter,"%i",ce_info->numParameters); 
    267271                SendMessage(socketfd,counter); 
     
    296300                                SendMessage(socketfd,oList[i]->affection_list[j].relation); 
    297301                        } 
    298                 } 
     302                }*/ 
    299303         
    300304 
     
    316320                }*/ 
    317321         
    318     } 
     322//    } 
    319323} 
    320324 
     
    384388        cout << "Configuration file parsing completed." << endl; 
    385389 
    386         pid = fork(); 
     390    print_current_config(uList, pList, oList, &ce_info); 
     391         
     392    pid = fork(); 
    387393        if(pid == 0) { 
    388394                // In child process - open policy engine port.