]> git.stg.codes - stg.git/commitdiff
SMUX reload with reconnect implemented
authorMaxim Mamontov <faust.madf@gmail.com>
Mon, 12 Sep 2011 09:37:33 +0000 (12:37 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Mon, 12 Sep 2011 09:37:33 +0000 (12:37 +0300)
projects/stargazer/plugins/other/smux/smux.cpp
projects/stargazer/plugins/other/smux/smux.h

index bcfc940e432f146a7fffa4e50c4fac1b526600df..8faccc2d3ed8de0fee1abd2c82beba906ae527d5 100644 (file)
@@ -256,6 +256,15 @@ printfd(__FILE__, "SMUX::Stop() - After\n");
 return 0;
 }
 
+int SMUX::Reload()
+{
+if (Stop())
+    return -1;
+if (Start())
+    return -1;
+return 0;
+}
+
 void * SMUX::Runner(void * d)
 {
 SMUX * smux = static_cast<SMUX *>(d);
index 45f16ea6824af4cc03b2af4b94131c4333a617d0..e16ae5f2f998e4e062d669f757fbf07ee09bc46e 100644 (file)
@@ -109,7 +109,7 @@ public:
 
     int Start();
     int Stop();
-    int Reload() { return 0; }
+    int Reload();
     bool IsRunning() { return running && !stopped; }
 
     const std::string & GetStrError() const { return errorStr; }