webrtc-rs / webrtc

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

Socket files for mDNS not closed after closing peer_connection? #601

Open deepushajia opened 1 month ago

deepushajia commented 1 month ago

/home/nvidia/.cargo/registry/src/index.crates.io-6f17d22bba15001f/webrtc-mdns-0.6.1/src/conn/mod.rs:75 | Error getting interfaces: Os { code: 24, kind: Uncategorized, message: "Too many open files" }

There seem to be a socket file leak happening, My code is similar to the one here: https://github.com/webrtc-rs/webrtc/blob/master/examples/examples/data-channels/data-channels.rs

Just that I am instantiating a tokio runtime async thread for every connection made, I make sure to use the peer_connection.close().await before the thread is closed. It works without issue normally, but when I reach somewhere around 200 connections (always occur at 190-210 range), this error pops up.

tubzby commented 1 month ago

Same here. I use lsof -n -p $pid to monitor the file description and it keep on increasing.