Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to troubleshoot when the onGatheringStateChange function returns very slowly? #1234

Open
bestxpp opened this issue Jul 22, 2024 · 1 comment

Comments

@bestxpp
Copy link

bestxpp commented Jul 22, 2024

        pc_->onGatheringStateChange([this, pc = pc_](rtc::PeerConnection::GatheringState state) {
			std::ostringstream oss;
			oss << state;
			LOG_INFO("Gathering State: {}", oss.str());

			if (state == rtc::PeerConnection::GatheringState::Complete) {
				auto		   description = pc->localDescription();
				nlohmann::json message	   = {{"type", description->typeString()}, {"sdp", std::string(description.value())}};
				// std::cout << message << std::endl;
				nlohmann::json sendOffer = {{"type:", wb_type::offer}, {"data", message.dump()}};
				LOG_INFO("send: {}", sendOffer.dump());
				MyWebSocket::get().send(sendOffer.dump());
			}
		});

the onGatheringStateChange function returns very slowly,It takes 20 to even 40 seconds to gather ICE information.
coturn and my application are running on the same host; the difference is that my application is running in a Docker container, while coturn is running on the host machine

@paullouisageneau
Copy link
Owner

It means one of your ICE servers is not reachable, so gathering done is only triggered after it times out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants