mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 23:45:27 +00:00
catch session error and exit (fix for trac ticket 11)
git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@416 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
@@ -75,7 +75,7 @@ CommandSession::CommandSession(std::string module_name,
|
|||||||
std::string spec_file_name,
|
std::string spec_file_name,
|
||||||
isc::data::ElementPtr(*config_handler)(isc::data::ElementPtr new_config),
|
isc::data::ElementPtr(*config_handler)(isc::data::ElementPtr new_config),
|
||||||
isc::data::ElementPtr(*command_handler)(isc::data::ElementPtr command)
|
isc::data::ElementPtr(*command_handler)(isc::data::ElementPtr command)
|
||||||
) :
|
) throw (isc::cc::SessionError):
|
||||||
module_name_(module_name),
|
module_name_(module_name),
|
||||||
session_(isc::cc::Session())
|
session_(isc::cc::Session())
|
||||||
{
|
{
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
CommandSession(std::string module_name, std::string spec_file_name,
|
CommandSession(std::string module_name, std::string spec_file_name,
|
||||||
isc::data::ElementPtr(*config_handler)(isc::data::ElementPtr new_config) = NULL,
|
isc::data::ElementPtr(*config_handler)(isc::data::ElementPtr new_config) = NULL,
|
||||||
isc::data::ElementPtr(*command_handler)(isc::data::ElementPtr command) = NULL
|
isc::data::ElementPtr(*command_handler)(isc::data::ElementPtr command) = NULL
|
||||||
);
|
) throw (isc::cc::SessionError);
|
||||||
int getSocket();
|
int getSocket();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -133,6 +133,7 @@ main(int argc, char* argv[]) {
|
|||||||
//plot = ParkingLot(port);
|
//plot = ParkingLot(port);
|
||||||
|
|
||||||
// initialize command channel
|
// initialize command channel
|
||||||
|
try {
|
||||||
CommandSession cs = CommandSession(PROGRAM, SPECFILE, my_config_handler, my_command_handler);
|
CommandSession cs = CommandSession(PROGRAM, SPECFILE, my_config_handler, my_command_handler);
|
||||||
|
|
||||||
// main server loop
|
// main server loop
|
||||||
@@ -162,6 +163,10 @@ main(int argc, char* argv[]) {
|
|||||||
cs.check_command();
|
cs.check_command();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (isc::cc::SessionError se) {
|
||||||
|
cout << se.what() << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user