优化随机端口分配逻辑

This commit is contained in:
xiongziliang
2022-05-14 23:34:33 +08:00
parent 8231c5c293
commit 251fe1f77c
2 changed files with 0 additions and 6 deletions

View File

@@ -410,9 +410,6 @@ private:
};
void makeSockPair(std::pair<Socket::Ptr, Socket::Ptr> &pair, const string &local_ip, bool re_use_port, bool is_udp) {
//全局互斥锁保护,防止端口重复分配
static recursive_mutex s_mtx;
lock_guard<recursive_mutex> lck(s_mtx);
int try_count = 0;
while (true) {
try {