/*********************************************************************************
 **
 ** SmartSamplerServer main task.  Just kick the guy off and log any resulting
 ** exceptions.
 **
 *********************************************************************************/
#include "Syslog.h"
#include "System.h"

#include "SmartSamplerServer.hh"
#include "SmartSampler.hh"

int main(int argc, char *argv[]) {
  int i;
  if( System::setTaskPriority(BackgroundPriority-2)==-1) 
    return 1;
  SmartSamplerServer *server = NULL;

  try {
    server = new SmartSamplerServer(SmartSamplerName);
    server->run();
  } catch(SharedObject::Error e) {
    Syslog::write("SmartSamplerServer - Caught exception: %s\n", e.msg);
  } catch(Exception e) {
    Syslog::write("SmartSamplerServer - Caught exception: %s\n", e.msg);
  } catch(...) {
    Syslog::write("SmartSamplerServer - Caught exception!\n");
  }
  if( NULL!=server )
    delete server;
  return 0;
}
