@@ -43,6 +43,7 @@ void usage(char **argv) {
4343 fprintf (stderr, " usage: %s [options]\n " , argv[0 ]);
4444 fprintf (stderr, " --help: print usage\n " );
4545 fprintf (stderr, " --broker-uri: broker uri with options e.g. tcp://127.0.0.1:61613?wireFormat=stomp&keepAlive=true\n " );
46+ fprintf (stderr, " --sleep-cycle: the time (in milliseconds) of the server sleep (default 15) \n " );
4647 fprintf (stderr, " " );
4748 fprintf (stderr, " \n\n " );
4849// fprintf(stderr, "bad argument: %s\n", *arg);
@@ -59,6 +60,7 @@ int main(int argc, char* argv[])
5960 std::string strBrokerURI = " tcp://127.0.0.1:61613?wireFormat=stomp&keepAlive=true" ;
6061 std::string strCommandInDestinationURI = " COMMAND.IN" ;
6162 std::string strGameEventOutDestinationURI = " GAME.EVENT.OUT" ;
63+ std::string strServerSleepCycle = " 1500" ;
6264
6365 LOG_F (INFO, " Starting..." );
6466 for (int i = 1 ; i < argc; ++i)
@@ -73,9 +75,14 @@ int main(int argc, char* argv[])
7375 // TODO: Error checking on arg
7476 strBrokerURI = argv[++i];
7577 }
78+ else if (0 == strcmp (argv[i], " --sleep-cycle" ))
79+ {
80+ strServerSleepCycle = argv[++i];
81+ }
7682 }
7783
7884 Configuration::Instance ().BrokerURI = strBrokerURI;
85+ Configuration::Instance ().ServerSleepCycle = strtol (strServerSleepCycle.c_str (), nullptr , 0 );
7986
8087 LOG_F (INFO, " Initializing the ActiveMQCPP library" );
8188 activemq::library::ActiveMQCPP::initializeLibrary ();
0 commit comments