Show
Ignore:
Timestamp:
03/22/09 15:00:49 (15 years ago)
Author:
bhilburn
Message:

PolicyEngine? code now compiling with new RemoteComponent? struct changes. Still
using old ClientSocket? function.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/policy_engines/PolicyEngine.cpp

    r182 r185  
    2424{ 
    2525    LOG("Creating Policy Engine.\n"); 
    26     SML = NULL; 
     26    SML_present = false; 
     27    control = new RemoteComponent; 
    2728    LoadPolicies(); 
    2829} 
     
    3132PolicyEngine::~PolicyEngine() 
    3233{ 
    33     if(SML) 
    34         delete SML; 
     34    delete control; 
    3535} 
    3636 
     
    4040    LOG("Creating Policy Engine.\n"); 
    4141 
    42     SML = new SML_Info; 
    43     SML->hostname = std::string(serverName); 
    44     SML->port = std::string(portNumber); 
     42    SML_present = true; 
     43    control = new RemoteComponent; 
     44    control->serverName = std::string(serverName); 
     45    control->serverPort = atoi(portNumber); 
    4546 
    46     SML->socketFD = ClientSocket(serverName, portNumber); 
    47     RegisterServices(SML->socketFD); 
     47    control->socketFD = ClientSocket(serverName, portNumber); 
     48    RegisterServices(control->socketFD); 
    4849 
    4950    LOG("Policy Engine connected to SML at %s.\n", serverName); 
     
    8283PolicyEngine::Shutdown() 
    8384{ 
    84     if(SML) 
    85         DeregisterServices(SML->socketFD); 
     85    if(SML_present) 
     86        DeregisterServices(control->socketFD); 
    8687    // TODO otherwise, deregister from shell 
    8788}