From 8f7db635a31f2817fa920e4d43bc8718f1bc070d Mon Sep 17 00:00:00 2001
From: chenjialing <595168663@qq.com>
Date: 星期三, 15 六月 2022 14:13:43 +0800
Subject: [PATCH] 优化----okhttp连接访问超时设置,访问异常code设置为-2
---
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
index bd3dcb1..77c5de6 100644
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
@@ -87,10 +87,15 @@
int result = -1;
// 鏌ヨ姝tp server 鏄惁宸茬粡瀛樺湪
JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId);
- if (rtpInfo != null && rtpInfo.getInteger("code") == 0 && rtpInfo.getBoolean("exist")) {
- result = rtpInfo.getInteger("local_port");
+ if(rtpInfo.getInteger("code") == 0){
+ if (rtpInfo.getBoolean("exist")) {
+ result = rtpInfo.getInteger("local_port");
+ return result;
+ }
+ }else if(rtpInfo.getInteger("code") == -2){
return result;
}
+
Map<String, Object> param = new HashMap<>();
// 鎺ㄦ祦绔彛璁剧疆0鍒欎娇鐢ㄩ殢鏈虹鍙�
param.put("enable_tcp", 1);
--
Gitblit v1.8.0