toverainc / willow-inference-server

Open source, local, and self-hosted highly optimized language inference server supporting ASR/STT, TTS, and LLM across WebRTC, REST, and WS
Apache License 2.0
373 stars 33 forks source link

Make sure we free dynamic media ports on client disconnect/disappear #38

Open kristiankielhofner opened 1 year ago

kristiankielhofner commented 1 year ago

Given the nature of webrtc and the support for those clients the ability for AIA to support $NUM clients is dependent on having free dynamic media ports available. We need to make sure when a datachannel connection closes that we free it and the port it has allocated for the multiplexed UDP session.

kristiankielhofner commented 1 year ago

From what I can tell it seems we allocate/listen on the entire defined range on init? Definitely could be wrong...

Usually that's not "how things are done" with dynamic, negotiated media ports in the real time communications space. Ideally we'd keep track of the pool, negotiated ports in use, and then allocate them with the creation of the session and free them at termination of session.

I'm also starting to wonder if this could possibly be related to the "cross-talk" issues Eric discovered...