summaryrefslogtreecommitdiff
path: root/rotord/rotord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/rotord.cpp')
-rwxr-xr-xrotord/rotord.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp
index bf1be02..27a09d7 100755
--- a/rotord/rotord.cpp
+++ b/rotord/rotord.cpp
@@ -283,8 +283,21 @@ void RotorServer::handleHelp(const std::string& name, const std::string& value){
int RotorServer::main(const std::vector<std::string>& args){
if (!_helpRequested) {
- unsigned short port = (unsigned short) config().getInt("port", 9980);
+
+ unsigned short port;
+
+ xmlIO xml;
+ if(xml.loadFile("settings.xml") ){
+ port=xml.getAttribute("Rotor","port",9980,0);
+ }
+ else cerr<<"Rotord: settings.xml not found, using defaults"<<endl;
+
+ port = (unsigned short) config().getInt("port", port); //override from command line
+
std::string format(config().getString("format", DateTimeFormat::SORTABLE_FORMAT));
+
+
+
ServerSocket svs(port);
HTTPServer srv(new RotorRequestHandlerFactory(),svs, new HTTPServerParams);
srv.start();