Browse Source

fix run-xxx.bat in windows

jarodruan 4 years ago
parent
commit
a8c34362f9

+ 53 - 52
examples/CMakeLists.txt

@@ -14,86 +14,87 @@ add_subdirectory(QuickStartDemo)
 add_subdirectory(StressDemo)
 
 if(WIN32)
+
     add_custom_target(run-quick-start
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS QuickStartDemo QuickStartDemoClient
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call quick start: ${CMAKE_SOURCE_DIR}")
+            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+            DEPENDS QuickStartDemo QuickStartDemoClient
+            COMMAND examples/scripts/run-quick-start.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+            COMMENT "call quick start")
 
     add_custom_target(run-http
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS HttpServer HttpClient
-        COMMAND examples\\scripts\\run-http.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call run http")
+            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+            DEPENDS HttpServer HttpClient
+            COMMAND examples/scripts/run-http.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+            COMMENT "call run http")
 
     add_custom_target(run-auth
             WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
             DEPENDS AuthServer AuthClient
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+            COMMAND examples/scripts/run-auth.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
             COMMENT "call run auth")
 
     if(TARS_HTTP2)
-    add_custom_target(run-http2
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS Http2Server Http2Client
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-http2.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call run http2")
+        add_custom_target(run-http2
+                WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+                DEPENDS Http2Server Http2Client
+                COMMAND examples/scripts/run-http2.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMENT "call run http2")
     endif()
 
     if(TARS_SSL)
-    add_custom_target(run-ssl
-            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-            DEPENDS SSLServer SSLClient
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-ssl.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-            COMMENT "call run ssl")
+        add_custom_target(run-ssl
+                WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+                DEPENDS SSLServer SSLClient
+                COMMAND examples/scripts/run-ssl.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMENT "call run ssl")
     endif()
 
     add_custom_target(run-co
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call run co")
+            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+            DEPENDS CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro
+            COMMAND examples/scripts/run-co.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+            COMMENT "call run co")
 
     add_custom_target(run-custom
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS CustomServer CustomClient
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-custom.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call run custom")
+            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+            DEPENDS CustomServer CustomClient
+            COMMAND examples/scripts/run-custom.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+            COMMENT "call run custom")
 
     add_custom_target(run-push
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS PushServer PushClient
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call run push")
+            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+            DEPENDS PushServer PushClient
+            COMMAND examples/scripts/run-push.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+            COMMENT "call run push")
 
     if(TARS_SSL)
-    add_custom_target(run-all
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient  SSLServer SSLClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMAND servant/script/busybox.exe bash examples/scripts/run-ssl.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-        COMMENT "call run all ${CMAKE_SOURCE_DIR}")
+        add_custom_target(run-all
+                WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+                DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient  SSLServer SSLClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
+                COMMAND examples/scripts/run-quick-start.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-http.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-co.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-push.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-auth.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-ssl.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMENT "call run all")
     else()
-    add_custom_target(run-all
-            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-            DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
-            COMMENT "call run all ${CMAKE_SOURCE_DIR}")
+        add_custom_target(run-all
+                WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+                DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
+                COMMAND examples/scripts/run-quick-start.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-http.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-co.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-push.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMAND examples/scripts/run-auth.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
+                COMMENT "call run all")
     endif()
 
+
     add_custom_target(run-kill
             WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-            COMMAND servant/script/busybox.exe bash examples/scripts/run-kill.sh
+            COMMAND examples/scripts/run-kill.bat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
             COMMENT "call run kill")
-
 else(WIN32)
 
     add_custom_target(run-quick-start

+ 16 - 13
examples/scripts/run-auth.bat

@@ -1,27 +1,30 @@
 
 echo "run-auth.bat"
 
-EXE_PATH=$1
-SRC_PATH=$2
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-echo ${EXE_PATH} ${SRC_PATH}
+echo %EXE_PATH% %SRC_PATH%
 
-killall -9 AuthServer.exe
-sleep 1
+taskkill /im AuthServer.exe /t /f
 
-echo "start server: .\\bin\\Release\\AuthServer.exe --config=..\\examples\\AuthDemo\\Server\\config.conf &"
+timeout /T 1
 
-.\\bin\\Release\\AuthServer.exe --config=..\\examples\\AuthDemo\\Server\\config.conf &
+echo "start server: %EXE_PATH%/AuthServer.exe --config=%SRC_PATH%/examples/AuthDemo/Server/config.conf"
 
-sleep 3
+start /b %EXE_PATH%\\AuthServer.exe --config=%SRC_PATH%\\examples\\AuthDemo\\Server\\config.conf
 
-echo "client: .\\bin\\Release\\SSLClient.exe"
+timeout /T 3
 
-.\\bin\\Release\\SSLClient.exe --count=10000 --thread=2 --call=sync  --buffersize=1000 --netthread=1
-.\\bin\\Release\\SSLClient.exe --count=10000 --thread=2 --call=async  --buffersize=1000 --netthread=1
+echo "client: ${EXE_PATH}/AuthClient.exe"
+
+%EXE_PATH%\\AuthClient.exe --count=10000 --thread=2 --call=sync  --buffersize=1000 --netthread=1
+%EXE_PATH%\\AuthClient.exe --count=10000 --thread=2 --call=async  --buffersize=1000 --netthread=1
+
+timeout /T 1
+
+taskkill /im AuthServer.exe /t /f
 
-sleep 1
 
-killall -9 AuthServer.exe
 
 

+ 24 - 19
examples/scripts/run-co.bat

@@ -1,44 +1,49 @@
 
 echo "run-co.bat"
 
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-killall -9 CoroutineDemoAServer.exe 
+echo %EXE_PATH% %SRC_PATH%
 
-sleep 1
+taskkill /im CoroutineDemoAServer.exe /t /f
 
-echo "start server: .\\bin\\Release\\CoroutineDemoAServer.exe --config=..\\examples\\CoroutineDemo\\AServer\\config.conf &"
+timeout /T 1
 
-.\\bin\\Release\\CoroutineDemoAServer.exe --config=..\\examples\\CoroutineDemo\\AServer\\config.conf &
+echo "start server: %EXE_PATH%\\CoroutineDemoAServer.exe --config=%SRC_PATH%\\examples\\CoroutineDemo\\AServer\\config.conf"
 
-#-------------------------------------------------------------------------------------------------------
+start /b %EXE_PATH%\\CoroutineDemoAServer.exe --config=%SRC_PATH%\\examples\\CoroutineDemo\\AServer\\config.conf
 
-killall -9 CoroutineDemoBServer.exe 
+::-------------------------------------------------------------------------------------------------------
 
-sleep 1
+taskkill /im CoroutineDemoBServer.exe /t /f
 
-echo "start server: .\\bin\\Release\\CoroutineDemoBServer.exe --config=..\\examples\\CoroutineDemo\\BServer\\config.conf &"
+timeout /T 1
 
-.\\bin\\Release\\CoroutineDemoBServer.exe --config=..\\examples\\CoroutineDemo\\BServer\\config.conf &
+echo "start server: %EXE_PATH%\\CoroutineDemoBServer.exe --config=%SRC_PATH%\\examples\\CoroutineDemo\\BServer\\config.conf "
 
+start /b %EXE_PATH%\\CoroutineDemoBServer.exe --config=%SRC_PATH%\\examples\\CoroutineDemo\\BServer\\config.conf
 
-#-------------------------------------------------------------------------------------------------------
-sleep 1
+
+::-------------------------------------------------------------------------------------------------------
+timeout /T 1
 
 echo "client: .\\bin\\CoroutineDemoClient"
 
-.\\bin\\Release\\CoroutineDemoClient.exe 2 10000 0
+%EXE_PATH%\\CoroutineDemoClient.exe 2 10000 0
+
+%EXE_PATH%\\CoroutineDemoClient.exe 2 10000 1
 
-.\\bin\\Release\\CoroutineDemoClient.exe 2 10000 1
+%EXE_PATH%\\testCoro.exe 1000
 
-.\\bin\\Release\\testCoro.exe 1000
+%EXE_PATH%\\testParallelCoro.exe 1000
 
-.\\bin\\Release\\testParallelCoro.exe 1000
+::-------------------------------------------------------------------------------------------------------
 
-#-------------------------------------------------------------------------------------------------------
+timeout /T 1
 
-sleep 1
+taskkill /im CoroutineDemoAServer.exe /t /f
+taskkill /im CoroutineDemoBServer.exe /t /f
 
-killall -9 CoroutineDemoAServer.exe 
-killall -9 CoroutineDemoBServer.exe 
 
 

+ 16 - 11
examples/scripts/run-custom.bat

@@ -1,22 +1,27 @@
-#!/bin/sh
 
 echo "run-push.bat"
 
-killall -9 CustomServer.exe 
-sleep 1
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-echo "start server: .\\bin\\Release\\CustomServer.exe --config=..\\examples\\CustomDemo\\CustomServer\\config.conf &"
+echo %EXE_PATH% %SRC_PATH%
 
-.\\bin\\Release\\CustomServer.exe --config=..\\examples\\CustomDemo\\CustomServer\\config.conf &
+taskkill /im CustomServer.exe /t /f
 
-sleep 3
+timeout /T 1
 
-#-------------------------------------------------------------------------------------------------------
+echo "start server: %EXE_PATH%\\CustomServer.exe --config=%SRC_PATH%\\examples\\CustomDemo\\CustomServer\\config.conf "
 
-echo "client: .\\bin\\Release\\CustomClient.exe"
+start /b %EXE_PATH%\\CustomServer.exe --config=%SRC_PATH%\\examples\\CustomDemo\\CustomServer\\config.conf
 
-.\\bin\\Release\\CustomClient.exe --count=10000 --thread=2 --call=sync --netthread=2 --buffersize=100
-.\\bin\\Release\\CustomClient.exe --count=10000 --thread=2 --call=async --netthread=2 --buffersize=100
+timeout /T 1
 
-killall -9 CustomServer.exe
+::-------------------------------------------------------------------------------------------------------
+
+echo "client: %EXE_PATH%\\CustomClient.exe"
+
+%EXE_PATH%\\CustomClient.exe --count=10000 --thread=2 --call=sync --netthread=2 --buffersize=100
+%EXE_PATH%\\CustomClient.exe --count=10000 --thread=2 --call=async --netthread=2 --buffersize=100
+
+taskkill /im CustomServer.exe /t /f
 

+ 16 - 10
examples/scripts/run-http2.bat

@@ -1,22 +1,28 @@
 
 echo "run-http2.bat"
 
-killall -9 Http2Server.exe 
-sleep 1
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-echo "start server: .\\bin\\Release\\Http2Server.exe --config=..\\examples\\HttpDemo\\Http2Server\\config.conf &"
+echo %EXE_PATH% %SRC_PATH%
 
-.\\bin\\Release\\Http2Server.exe --config=..\\examples\\HttpDemo\\Http2Server\\config.conf &
+taskkill /im Http2Server.exe /t /f
 
-sleep 3
+timeout /T 1
 
-echo "client: .\\bin\\Release\\Http2Client.exe"
+echo "start server: %EXE_PATH%\\Http2Server.exe --config=%SRC_PATH%\\examples\\HttpDemo\\Http2Server\\config.conf "
 
-.\\bin\\Release\\Http2Client.exe --count=10000 --thread=2 --call=sync
-.\\bin\\Release\\Http2Client.exe --count=10000 --thread=2 --call=async
+start /b %EXE_PATH%\\Http2Server.exe --config=%SRC_PATH%\\examples\\HttpDemo\\Http2Server\\config.conf
 
-sleep 1
+timeout /T 3
 
-killall -9 Http2Server.exe 
+echo "client: %EXE_PATH%\\Http2Client.exe"
+
+%EXE_PATH%\\Http2Client.exe --count=10000 --thread=2 --call=sync
+%EXE_PATH%\\Http2Client.exe --count=10000 --thread=2 --call=async
+
+timeout /T 1
+
+taskkill /im Http2Server.exe /t /f
 
 

+ 10 - 1
examples/scripts/run-kill.bat

@@ -14,4 +14,13 @@ taskkill /im QuickStartDemo.exe /f
 taskkill /im ProxyServer.exe /f
 taskkill /im busybox.exe /f
 
-
+taskkill /im HttpClient.exe /f
+taskkill /im Http2Client.exe /f
+taskkill /im AuthClient.exe /f
+taskkill /im SSLClient.exe /f
+taskkill /im CoroutineDemoClient.exe /f
+taskkill /im testCoro.exe /f
+taskkill /im testParallelCoro.exe /f
+taskkill /im CustomClient.exe /f
+taskkill /im PushClient.exe /f
+taskkill /im QuickStartDemoClient.exe /f

+ 2 - 2
examples/scripts/run-kill.sh

@@ -7,13 +7,13 @@ killall -9 AuthServer
 killall -9 CoroutineDemoAServer
 killall -9 CoroutineDemoBServer
 killall -9 CustomServer
-killall -9 HttpServer.exe
+killall -9 HttpServer
 killall -9 Http2Server
 killall -9 PushServer
 killall -9 QuickStartDemo
 killall -9 ProxyServer
 
-killall -9 HttpClient.exe
+killall -9 HttpClient
 killall -9 Http2Client
 killall -9 AuthClient
 killall -9 SSLClient

+ 15 - 10
examples/scripts/run-push.bat

@@ -1,21 +1,26 @@
-#!/bin/sh
 
 echo "run-push.bat"
 
-killall -9 PushServer.exe 
-sleep 1
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-echo "start server: .\\bin\\Release\\PushServer.exe --config=..\\examples\\PushDemo\\PushServer\\config.conf &"
+echo %EXE_PATH% %SRC_PATH%
 
-.\\bin\\Release\\PushServer.exe --config=..\\examples\\PushDemo\\PushServer\\config.conf &
+taskkill /im PushServer.exe /t /f
 
-sleep 3
+timeout /T 1
 
-#-------------------------------------------------------------------------------------------------------
+echo "start server: %EXE_PATH%\\PushServer.exe --config=%SRC_PATH%\\examples\\PushDemo\\PushServer\\config.conf"
 
-echo "client: .\\bin\\Release\\PushClient.exe"
+start /b %EXE_PATH%\\PushServer.exe --config=%SRC_PATH%\\examples\\PushDemo\\PushServer\\config.conf
 
-.\\bin\\Release\\PushClient.exe 5
+timeout /T 3
 
-killall -9 PushServer.exe
+::-------------------------------------------------------------------------------------------------------
+
+echo "client: %EXE_PATH%\\PushClient.exe"
+
+%EXE_PATH%\\PushClient.exe 5
+
+taskkill /im PushServer.exe /t /f
 

+ 20 - 17
examples/scripts/run-quick-start.bat

@@ -1,34 +1,37 @@
 
 echo "run-quick-start.bat"
 
-killall -9 QuickStartDemo.exe 
-killall -9 roxyServer.exe
-sleep 1
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-echo "start server: .\\bin\\Release\\QuickStartDemo.exe --config=..\\examples\\QuickStartDemo\\HelloServer\\Server\\config.conf &"
+echo %EXE_PATH% %SRC_PATH%
 
-.\\bin\\Release\\QuickStartDemo.exe --config=..\\examples\\QuickStartDemo\\HelloServer\\Server\\config.conf &
-.\\bin\\Release\\ProxyServer.exe --config=..\\examples\\QuickStartDemo\\ProxyServer\\Server\\config.conf &
+taskkill /im QuickStartDemo.exe /t /f
+taskkill /im ProxyServer.exe /t /f
+timeout /T 1
 
-sleep 3
+echo "start server: %EXE_PATH%\\QuickStartDemo.exe --config=%SRC_PATH%\\examples\\QuickStartDemo\\HelloServer\\Server\\config.conf "
 
-echo "client: .\\bin\\Release\\QuickStartDemoClient.exe"
+start /b %EXE_PATH%\\QuickStartDemo.exe --config=%SRC_PATH%\\examples\\QuickStartDemo\\HelloServer\\Server\\config.conf
+start /b %EXE_PATH%\\ProxyServer.exe --config=%SRC_PATH%\\examples\\QuickStartDemo\\ProxyServer\\Server\\config.conf
 
-.\\bin\\Release\\QuickStartDemoClient.exe --count=100000 --call=sync --thread=2 --buffersize=100 --netthread=2
+timeout /T 3
 
-.\\bin\\Release\\QuickStartDemoClient.exe --count=100000 --call=async --thread=2 --buffersize=100 --netthread=2
+echo "client: %EXE_PATH%\\QuickStartDemoClient.exe"
 
-.\\bin\\Release\\QuickStartDemoClient.exe --count=100000 --call=synctup --thread=2 --buffersize=100 --netthread=2
+%EXE_PATH%\\QuickStartDemoClient.exe --count=100000 --call=sync --thread=2 --buffersize=100 --netthread=2
 
-.\\bin\\Release\\QuickStartDemoClient.exe --count=100000 --call=asynctup --thread=2 --buffersize=100 --netthread=2
+%EXE_PATH%\\QuickStartDemoClient.exe --count=100000 --call=async --thread=2 --buffersize=100 --netthread=2
 
-echo "client: .\\bin\\Release\\ProxyServerClient.exe"
+%EXE_PATH%\\QuickStartDemoClient.exe --count=100000 --call=synctup --thread=2 --buffersize=100 --netthread=2
 
-.\\bin\\Release\\ProxyServerClient.exe
+%EXE_PATH%\\QuickStartDemoClient.exe --count=100000 --call=asynctup --thread=2 --buffersize=100 --netthread=2
 
-sleep 2
+echo "client: %EXE_PATH%\\ProxyServerClient.exe"
 
-killall -9 ProxyServer.exe
-killall -9 QuickStartDemo.exe
+%EXE_PATH%\\ProxyServerClient.exe
 
+timeout /T 1
 
+taskkill /im QuickStartDemo.exe /t /f
+taskkill /im ProxyServer.exe /t /f

+ 17 - 11
examples/scripts/run-ssl.bat

@@ -1,25 +1,31 @@
 
 echo "run-ssl.bat"
 
-killall -9 SSLServer.exe
-sleep 1
+set EXE_PATH=%1
+set SRC_PATH=%2
 
-echo "start server: .\\bin\\Release\\SSLServer.exe --config=..\\examples\\SSLDemo\\Server\\config.conf &"
+echo %EXE_PATH% %SRC_PATH%
 
-.\\bin\\Release\\SSLServer.exe --config=..\\examples\\SSLDemo\\Server\\config.conf &
+taskkill /im SSLServer.exe /t /f
+timeout /T 1
+
+echo "start server: %EXE_PATH%\\SSLServer.exe --config=%SRC_PATH%\\examples\\SSLDemo\\Server\\config.conf "
+
+start /b %EXE_PATH%\\SSLServer.exe --config=%SRC_PATH%\\examples\\SSLDemo\\Server\\config.conf
 
 sleep 3
 
-echo "client: .\\bin\\Release\\SSLClient.exe"
+echo "client: %EXE_PATH%\\SSLClient.exe"
+
+%EXE_PATH%\\SSLClient.exe --count=10000 --thread=2 --call=sync  --buffersize=1000 --netthread=1
+%EXE_PATH%\\SSLClient.exe --count=10000 --thread=2 --call=async  --buffersize=1000 --netthread=1
 
-.\\bin\\Release\\SSLClient.exe --count=10000 --thread=2 --call=sync  --buffersize=1000 --netthread=1
-.\\bin\\Release\\SSLClient.exe --count=10000 --thread=2 --call=async  --buffersize=1000 --netthread=1
+%EXE_PATH%\\SSLClient.exe --count=10000 --thread=2 --call=syncauth  --buffersize=1000 --netthread=1
+%EXE_PATH%\\SSLClient.exe --count=10000 --thread=2 --call=asyncauth  --buffersize=1000 --netthread=1
 
-.\\bin\\Release\\SSLClient.exe --count=10000 --thread=2 --call=syncauth  --buffersize=1000 --netthread=1
-.\\bin\\Release\\SSLClient.exe --count=10000 --thread=2 --call=asyncauth  --buffersize=1000 --netthread=1
+timeout /T 1
 
-sleep 1
+taskkill /im SSLServer.exe /t /f
 
-killall -9 SSLServer.exe