From 021b2757178140f5a9d27e6d0bb5992c2d69c3ed Mon Sep 17 00:00:00 2001 From: acgist <289547414@qq.com> Date: Wed, 14 Jun 2023 11:59:25 +0800 Subject: [PATCH] =?UTF-8?q?[*]=20=E6=97=A5=E5=B8=B8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taoyao-signal-server/README.md | 44 +++++++++++++-------------- taoyao-signal-server/docs/bin/stop.sh | 4 +-- taoyao-signal-server/docs/bin/wait.sh | 23 ++++++++------ taoyao-signal-server/pom.xml | 8 ++--- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/taoyao-signal-server/README.md b/taoyao-signal-server/README.md index 71d290b..700f182 100644 --- a/taoyao-signal-server/README.md +++ b/taoyao-signal-server/README.md @@ -20,26 +20,26 @@ ## SDP格式 ``` -v= (protocol version) #协议版本 -o= (owner/creator and session identifier) #所有者创建者和会话标识符 -s= (session name) #会话名称 -i=* (session information) #会话信息 -u=* (URI of description) #URI描述 -e=* (email address) #Email地址 -p=* (phone number) #电话号码 -c=* (connection information - not required if included in all media) #连接信息(如果包含在所有媒体中则不需要该字段) -b=* (zero or more bandwidth information lines) #带宽信息 -z=* (time zone adjustments) #时区调整 -k=* (encryption key) #加密密钥 -a=* (zero or more session attribute lines) #0或多次会话属性 -Time description #时间描述 -t= (time the session is active) #会话活动时间 -r=* (zero or more repeat times) #0或多次重复次数 -​Media description #媒体描述 -m= (media name and transport address) #媒体名称和传输地址 -i=* (media title) #媒体标题 -c=* (connection information - optional if included at session-level) #连接信息(如果包含在会话层则该字段可选) -b=* (zero or more bandwidth information lines) #带宽信息 -k=* (encryption key) #加密密钥 -a=* (zero or more media attribute lines) #0或多个会话属性 +v= (protocol version) # 协议版本 +o= (owner/creator and session identifier) # 所有者/创建者和会话标识符 +s= (session name) # 会话名称 +i=* (session information) # 会话信息 +u=* (URI of description) # URI描述 +e=* (email address) # Email地址 +p=* (phone number) # 电话号码 +c=* (connection information - not required if included in all media) # 连接信息 +b=* (zero or more bandwidth information lines) # 零或多个带宽信息 +z=* (time zone adjustments) # 时区调整 +k=* (encryption key) # 加密密钥 +a=* (zero or more session attribute lines) # 零或多次会话属性 +Time description # 时间描述 +t= (time the session is active) # 会话活动时间 +r=* (zero or more repeat times) # 零或多次重复次数 +​Media description # 媒体描述 +m= (media name and transport address) # 媒体名称和传输地址 +i=* (media title) # 媒体标题 +c=* (connection information - optional if included at session-level) # 连接信息 +b=* (zero or more bandwidth information lines) # 零或多个带宽信息 +k=* (encryption key) # 加密密钥 +a=* (zero or more media attribute lines) # 零或多个会话属性 ```` diff --git a/taoyao-signal-server/docs/bin/stop.sh b/taoyao-signal-server/docs/bin/stop.sh index 7100aa0..0cd7cad 100644 --- a/taoyao-signal-server/docs/bin/stop.sh +++ b/taoyao-signal-server/docs/bin/stop.sh @@ -5,7 +5,7 @@ ######################### killIndex=0 -processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") +processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}') if [ ! -z "$processId" ]; then echo "关闭应用:${project.artifactId}-${project.version} - $processId" while [ ! -z "$processId" ] @@ -21,7 +21,7 @@ if [ ! -z "$processId" ]; then fi sleep 1 killIndex=$((killIndex+1)) - processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") + processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}') done echo "" fi diff --git a/taoyao-signal-server/docs/bin/wait.sh b/taoyao-signal-server/docs/bin/wait.sh index 1afe0ce..b8aee69 100644 --- a/taoyao-signal-server/docs/bin/wait.sh +++ b/taoyao-signal-server/docs/bin/wait.sh @@ -4,20 +4,25 @@ # 等待任务 # ######################### -# 休眠一秒:等待后台任务调度 -sleep 2 aTime=$(date +%s) +waitIndex=0 processCt=0 -processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") +processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}') +while [ -z "$processId" ] && [ $waitIndex -le 8 ] +do + echo "等待调度:${project.artifactId}-${project.version}" + sleep 1 + waitIndex=$((waitIndex+1)) + processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}') +done if [ ! -z "$processId" ]; then - echo "等待应用:${project.artifactId}-${project.version} - $processId" - waitIndex=0 + echo "等待启动:${project.artifactId}-${project.version} - $processId" processCt=$(netstat -anop | grep $processId | grep LISTEN | wc -l) while [ ! -z "$processId" ] && [ $processCt -lt 1 ] && [ $waitIndex -le 120 ] do sleep 1 waitIndex=$((waitIndex+1)) - processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") + processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}') if [ ! -z "$processId" ]; then processCt=$(netstat -anop | grep $processId | grep LISTEN | wc -l) else @@ -33,8 +38,8 @@ if [ $processCt -lt 1 ]; then exit 0 else zTime=$(date +%s) - cTime=$((finishTime-aTime)) + processTime=$((zTime-aTime)) echo -e "\033[32m启动成功:${project.artifactId}-${project.version} - $processId\033[0m" - echo "启动端口:$(netstat -anop | grep $processId | grep LISTEN | awk "{print $4}")" - echo "启动耗时:$cTime S" + echo "启动端口:$(netstat -anop | grep $processId | grep LISTEN | awk '{print $4}')" + echo "启动耗时:$processTime S" fi diff --git a/taoyao-signal-server/pom.xml b/taoyao-signal-server/pom.xml index 888ce9e..63267d9 100644 --- a/taoyao-signal-server/pom.xml +++ b/taoyao-signal-server/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.0.3 + 3.1.0 @@ -23,9 +23,9 @@ 17 - 1.18.26 - 2.0.2 - 1.5.2.Final + 1.18.28 + 2.1.0 + 1.5.5.Final ${project.basedir} UTF-8