mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Add 1 second time interval for retry join transmission
This commit is contained in:
@@ -117,7 +117,7 @@ int IceAgent::DestroyIceAgent() {
|
||||
nice_thread_->join();
|
||||
}
|
||||
|
||||
LOG_ERROR("Destroy nice agent success");
|
||||
LOG_INFO("Destroy nice agent success");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -273,6 +273,7 @@ int PeerConnection::Join(const std::string &transmission_id,
|
||||
int ret = 0;
|
||||
|
||||
password_ = password;
|
||||
leave_ = false;
|
||||
|
||||
transmission_id_ = transmission_id;
|
||||
ret = RequestTransmissionMemberList(transmission_id_, password);
|
||||
@@ -295,6 +296,7 @@ int PeerConnection::Leave() {
|
||||
}
|
||||
|
||||
ice_ready_ = false;
|
||||
leave_ = true;
|
||||
|
||||
for (auto &user_id_it : ice_transmission_list_) {
|
||||
user_id_it.second->DestroyIceTransmission();
|
||||
@@ -338,8 +340,13 @@ void PeerConnection::ProcessSignal(const std::string &signal) {
|
||||
on_connection_status_(ConnectionStatus::NoSuchTransmissionId);
|
||||
}
|
||||
} else {
|
||||
if (leave_) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (user_id_list_.empty()) {
|
||||
LOG_WARN("Wait for host create transmission [{}]", transmission_id);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
RequestTransmissionMemberList(transmission_id, password_);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class PeerConnection {
|
||||
std::vector<std::string> user_id_list_;
|
||||
SignalStatus signal_status_ = SignalStatus::SignalClosed;
|
||||
std::mutex signal_status_mutex_;
|
||||
bool leave_ = false;
|
||||
std::atomic<bool> leave_ = false;
|
||||
|
||||
private:
|
||||
std::map<std::string, std::unique_ptr<IceTransmission>>
|
||||
|
||||
Reference in New Issue
Block a user