webrtc-rs / webrtc

A pure Rust implementation of WebRTC
https://webrtc.rs
Apache License 2.0
3.95k stars 347 forks source link

after call "create_answer", keep block. #572

Closed dxh-sc closed 1 month ago

dxh-sc commented 2 months ago

i faced a strange problem, the code like this

let offer = RTCSessionDescription::offer(offer_str.to_string());
            if offer.is_err() {
                log::error!("offer error: {:?}", offer);
                return Err("offer error".to_string());
            }
            let offer = offer.unwrap();
            let re = pcc.set_remote_description(offer).await;
            if re.is_err() {
                log::error!("set remote description error: {:?}", re);
                return Err("set remote description error".to_string());
            }

            log::info!("set remote description success");

            let answer = pcc.create_answer(None).await;
            if answer.is_err() {
                log::error!("create answer error: {:?}", answer);
                return Err("create answer error".to_string());
            }
            let answer = answer.unwrap();
            let answer_str = serde_json::to_string(&answer).unwrap();
            log::info!("answer: {}", answer_str);

it will block create_answer method, will don't excute next line code.

this is the log image

there have something case the issue?

dxh-sc commented 1 month ago

found the issue.