Author: remi
Date: 2009-07-15 14:10:59 +0200 (Wed, 15 Jul 2009)
New Revision: 5116

Modified:
   software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py
Log:
* Updated stop server method

Modified: software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py    
2009-07-15 11:51:57 UTC (rev 5115)
+++ software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py    
2009-07-15 12:10:59 UTC (rev 5116)
@@ -15,6 +15,7 @@
 import sys
 import os
 import getopt
+import time
 
 from util.smartcore.OldProcessKiller import killOldSmartCoreChildren
 from util.smartcore.OldProcessKiller import killPreviousSmartServer
@@ -26,18 +27,23 @@
     return URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/", 200, 5.0)
 
 def killServer():
-    killOldSmartCoreChildren()
+    # Stop the server regularly
     URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/server/stop?", 200, 0.5)
     URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/server/stop?", 200, 0.5)
+    # Wait 5 secs max that the previous server has been stopped
+    for i in range(10):
+        if not checkServerRun():
+            break
+        time.sleep(0.5)
+    # Kill smart-core tasks if still alive
+    killOldSmartCoreChildren()
     killPreviousSmartServer()
+    # Refresh taskbar icons
     refreshTaskBar()
 
 def killServerAndWait():
-    import time
     killServer()
     time.sleep(0.5)
-    while checkServerRun():
-        time.sleep(0.5)
 
 def runServer():
     killOldSmartCoreChildren()


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to