]> git.stg.codes - stg.git/blobdiff - projects/sgauthstress/main.cpp
Timeout fixed, proto starting and stopping added
[stg.git] / projects / sgauthstress / main.cpp
index f4e94b4f61921d6d076e85f7c9cf1702a59bc240..c7e69c4a962ce8fed23f3eb7e0c41d57338f0fa2 100644 (file)
@@ -98,7 +98,13 @@ SetSignalHandlers();
 PROTO proto(settings.GetServerName(),
             settings.GetServerPort(),
             settings.GetLocalPort(),
-            1);
+            1000);
+
+if (!proto.Start())
+    {
+    std::cerr << "Failed to start listening thread: '" << proto.GetStrError() << "'" << std::endl;
+    return -1;
+    }
 
 STORE_LOADER storeLoader(settings.GetModulesPath(), settings.GetStoreModuleSettings());
 if (storeLoader.Load())
@@ -130,7 +136,8 @@ for (it = userList.begin(); it != userList.end(); ++it)
                 *it,
                 userConf.password,
                 userConf.ips[0].ip
-            )
+            ),
+            true
     );
     }
 
@@ -142,6 +149,8 @@ while (running)
     usleep(200000);
     }
 
+proto.Stop();
+
 storeLoader.Unload();
 
 return 0;