You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application, I've observed that when a TURN server is used as a proxy, numerous UDP sockets remain open even after all network activities have ceased and there are no clients connected. I've pinpointed the issue to this section of code: https://github.com/webrtc-rs/webrtc/blob/master/turn/src/client/mod.rs#L235-L241. The problem appears to stem from the recv_from method, which lacks a timeout mechanism.
To address this issue, I'm considering implementing a timeout for the recv_from call to ensure it doesn't hang indefinitely. Here's a proposed solution:
let(n, from) = match tokio::time::timeout(timeout_duration, conn.recv_from(&mut buf)).await{Ok(Ok((n, from))) => (n, from),// Successfully received data within the set timeoutOk(Err(err)) => {
log::debug!("Encountered a network error: {}", err);break;}Err(_) => {
log::debug!("The recv_from call timed out after {:?}", timeout_duration);break;// Terminating the loop if a timeout is encountered}};
which works for me, not sure if that'd work for you. Any thoughts on that?
The text was updated successfully, but these errors were encountered:
In my application, I've observed that when a TURN server is used as a proxy, numerous UDP sockets remain open even after all network activities have ceased and there are no clients connected. I've pinpointed the issue to this section of code: https://github.com/webrtc-rs/webrtc/blob/master/turn/src/client/mod.rs#L235-L241. The problem appears to stem from the
recv_from
method, which lacks a timeout mechanism.To address this issue, I'm considering implementing a timeout for the
recv_from
call to ensure it doesn't hang indefinitely. Here's a proposed solution:which works for me, not sure if that'd work for you. Any thoughts on that?
The text was updated successfully, but these errors were encountered: