Skip to content

Commit fe59b68

Browse files
committed
启动多线程echo网络服务、线程池echo网络服务、NIO echo网络服务的脚本
1 parent 7847c88 commit fe59b68

4 files changed

Lines changed: 23 additions & 0 deletions

File tree

bin/start.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
APP_BIN_PATH=''
2+
x=`echo $0 | grep "^/"`
3+
if test "${x}"; then
4+
APP_BIN_PATH=`dirname $0`
5+
else
6+
PWD=`pwd`
7+
APP_BIN_PATH=`dirname $PWD/$0`
8+
fi
9+
APP_HOME=$APP_BIN_PATH/..
10+
APP_LIB_PATH=$APP_HOME/lib
11+
APP_CLASSPATH="."
12+
for filename in `ls $APP_LIB_PATH/*.jar`
13+
do
14+
APP_CLASSPATH=$APP_CLASSPATH:$filename
15+
done
16+
APP_CLASSPATH=$APP_CLASSPATH:$APP_HOME/classes
17+
18+
PARAMS=$1' '$2
19+
EXEC='java -Djava.util.logging.config.file='$APP_HOME'/classes/logging.properties -Dfile.encoding=UTF-8 -classpath '$APP_CLASSPATH' '$PARAMS
20+
exec $EXEC

bin/startMultiThreadEchoServer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source ./start.sh cn.aofeng.demo.io.MultiThreadEchoServer 9090

bin/startNioEchoServer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source ./start.sh cn.aofeng.demo.nio.NioEchoServer 9090

bin/startThreadPoolEchoServer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source ./start.sh cn.aofeng.demo.io.ThreadPoolEchoServer 9090

0 commit comments

Comments
 (0)