#include #include #include "../ax_alert_server/AlertConfig.h" #include "../shared/GlobalConfigFile.h" #include "../shared/Ping.h" #include "../shared/ReplyToClient.h" #include "../shared/InputFramework.h" #include "../shared/CommandDispatcher.h" #include "../shared/NewConnections.h" #include "AlertsOutput.h" #include "ParserTest.h" #include "TestSpecificAlerts.h" #include "Parse.h" #include "DataFormat.h" #include "RecordDispatcher.h" #include "FeedNextServer.h" #include "MultiCastFeedNextServer.h" #include "BinaryLog.h" #include "CopyAlertsToDatabase.h" #include "CopyTopListToDatabase.h" #include "SimpleAlertTest.h" #include "DelayedAlerts.h" #include "TopListWorkers.h" #include "AutoSecondaryData.h" #include "EmailSms.h" #include "AlertMicroService.h" #include "TopListMicroService.h" #include "../oddsmaker/UserInfo.h" #include "AutoSymbolListScheduler.h" #include "AlertRecordMultiCast.h" int main(int argc, char** argv) { setlocale(LC_ALL, ""); addConfigItems("listen_port=7897"); addConfigItems("zlib_level=Z_BEST_SPEED"); if (!addConfigItemsFromCommandLine(argv + 1)) { _exit(1); } configItemsComplete(); initAutoSymbolListScheduler(); AllConfigInfo::init(/* fixFloats = */ false); // ./fast_alert_search -i test_alerts_output=1 // This will send results to the log file. if (getConfigItem("test_alerts_output") == "1") AlertsOutput::test(); optionallyTestSpecificAlerts(); optionallyTestParser(); int listenPort = strtolDefault(getConfigItem("listen_port"), -1); if (listenPort == -1) { std::cerr<<"Invalid listen port \""<getInput(), commandDispatcher->getInputCallbackId()); IRecordDispatcher::init(); initFeedNextServer(); initMultiCastFeedNextServer(); initBinaryLog(); initCopyAlertsToDatabase(); initCopyTopListToDatabase(); initSimpleAlertTest(); delayedAlertsInit(); initTopListWorkers(); initEmailSms(); initAlertMicroService(); initTopListMicroService(); if (getConfigItem("micro_service_login") == "1") initUserInfoManager(); // Start listening to new sockets now, after the other modules have // had time to configure themselves. NewConnections newConnections(&listener, listenPort); if (!newConnections.getSuccess()) { std::cerr<<"Unable to listen for new connections.\n"; _exit(3); } while (true) sleep(60); }