From 6e445614b4216c0453c9e447fb1396e9a0ab77aa Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 8 Jan 2022 16:07:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7udp=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=85=A8=E5=B1=80=E4=BA=92=E6=96=A5=E9=94=81?= =?UTF-8?q?=E4=BF=9D=E6=8A=A4=EF=BC=8C=E9=98=B2=E6=AD=A2=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=88=86=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index 0a7f4c35..7dc8456b 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -386,6 +386,9 @@ static void makeSockPair_l(std::pair &pair, const stri } void makeSockPair(std::pair &pair, const string &local_ip) { + //全局互斥锁保护,防止端口重复分配 + static recursive_mutex s_mtx; + lock_guard lck(s_mtx); int try_count = 0; while (true) { try {