commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided concept id list, over './sample.<concept id>.csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved word \"all\" activates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it).");
commandLine.add("burstLog", anna::CommandLine::Argument::Optional, "Burst operations log file. By default 'launcher.burst'. Empty string or \"null\" name, to disable. Warning: there is no rotation for log files (use logrotate or whatever). Output: dot (.) for each burst message sent/pushed, cross (x) for popped ones, and order number when multiple of 1% of burst list size, plus OTA requests when changed.");
// Communications
- commandLine.add("httpServer", anna::CommandLine::Argument::Mandatory, "HTTP Management interface address (using i.e. curl tool) in '<address>:<port>' format. For example: 10.20.30.40:8080");
+ commandLine.add("httpServer", anna::CommandLine::Argument::Optional, "HTTP Management interface address (using i.e. curl tool) in '<address>:<port>' format. For example: 10.20.30.40:8080");
commandLine.add("httpServerShared", anna::CommandLine::Argument::Optional, "Enables shared bind for HTTP Management interface address. It would be useful i.e. to allow a great amount of curl operations per second", false);
commandLine.add("diameterServer", anna::CommandLine::Argument::Optional, "Diameter own server address in '<address>:<port>' format. For example: 10.20.30.40:3868");
commandLine.add("diameterServerSessions", anna::CommandLine::Argument::Optional, "Diameter own server available connections (0: diameter server disabled). Default value of 1");
anna::Logger::information(msg, ANNA_FILE_LOCATION);
);
// HTTP Server:
- anna::comm::Network& network = anna::comm::Network::instantiate();
- std::string address;
- int port;
- anna::functions::getAddressAndPortFromSocketLiteral(cl.getValue("httpServer"), address, port);
-// const anna::comm::Device* device = network.find(Device::asAddress(address)); // aqui hay que proporcionar una IP !
- const anna::comm::Device* device = *((network.resolve(address)->device_begin())); // ArtimaƱa para resolver (IP o hostname)
- a_httpServerSocket = new anna::comm::ServerSocket(anna::comm::INetAddress(device, port), cl.exists("httpServerShared") /* shared bind */, &anna::http::Transport::getFactory());
+ if (cl.exists("httpServer")) {
+ anna::comm::Network& network = anna::comm::Network::instantiate();
+ std::string address;
+ int port;
+ anna::functions::getAddressAndPortFromSocketLiteral(cl.getValue("httpServer"), address, port);
+ //const anna::comm::Device* device = network.find(Device::asAddress(address)); // aqui hay que proporcionar una IP !
+ const anna::comm::Device* device = *((network.resolve(address)->device_begin())); // ArtimaƱa para resolver (IP o hostname)
+ a_httpServerSocket = new anna::comm::ServerSocket(anna::comm::INetAddress(device, port), cl.exists("httpServerShared") /* shared bind */, &anna::http::Transport::getFactory());
+ }
+
// Stack:
anna::diameter::codec::Engine *codecEngine = new anna::diameter::codec::Engine();
anna::diameter::stack::Engine &stackEngine = anna::diameter::stack::Engine::instantiate();
}
a_communicator->setRecoveryTime((const anna::Millisecond)reconnectionPeriod);
- a_communicator->attach(a_httpServerSocket); // HTTP
+ if (cl.exists("httpServer")) a_communicator->attach(a_httpServerSocket); // HTTP
a_communicator->accept();
}