#include #include #include "../shared/Messages.h" #include "../shared/SocketInfo.h" #include "../shared/InputFramework.h" #include "../shared/CommandDispatcher.h" #include "../shared/ReplyToClient.h" #include "../shared/NewConnections.h" #include "../shared/GlobalConfigFile.h" #include "UserInfo.h" #include "ForwardingThread.h" #include "../shared/Ping.h" int main(int argc, char *argv[]) { setlocale(LC_ALL, ""); if (!addConfigItemsFromCommandLine(argv + 1)) { return 1; } configItemsComplete(); const std::string testConfig = getConfigItem("test_config"); if (!testConfig.empty()) { const std::string errorMessage = testForwardingConfigFile(testConfig); if (errorMessage.empty()) // Success! _exit(0); // Failure! std::cerr<<"Invalid config file: "<getInput(), commandDispatcher->getInputCallbackId()); // 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"; return 3; } while (true) sleep(60); }