Add nice_agent_clear_stream_local_addresses#18
Conversation
Agent-Logs-Url: https://github.com/pexip/libnice/sessions/285af649-49e4-46aa-b4da-604a0fdfd6bf Co-authored-by: bitflows <19825042+bitflows@users.noreply.github.com>
|
@copilot does libnice allow adding additional local_addresses while its running, and will a new entry be picked up immediately, and new clients gathered? |
You can add them at any time, but they are not picked up automatically — they only take effect on the next Looking at
So in practice:
The typical pattern with the new nice_agent_clear_stream_local_addresses(agent, stream_id);
nice_agent_add_stream_local_address(agent, stream_id, &new_addr);
nice_agent_gather_candidates(agent, stream_id);If you want "added → immediately gathered" without an explicit re-gather call, that behaviour doesn't exist in libnice today and would need a new code path. |
|
@copilot In pulse_network_monitor.c, I've spotted a bug. We get events from glib_network_monitor, and act on them. But, we seems to get an IPv4 address first, then if there is a IPv6 dhcp, it will take a few rounds before it finally has the "final" IPv6 address. |
That file isn't part of libnice — That said, here's the shape of what you're describing in case it's useful when you raise it in the right repo:
If you can point me at the correct repo/PR I'm happy to do the implementation there. |
Exposes a way to drop the configured local addresses on a stream so callers can replace them, complementing the existing
nice_agent_add_stream_local_address.agent/agent.h: declarenice_agent_clear_stream_local_addresses(NiceAgent *, guint stream_id).agent/agent.c: implementation takes the agent lock, looks up the stream, frees eachNiceAddressinstream->local_addresses, frees the list, and nulls it out — mirroring the cleanup already performed instream_free(). ReturnsFALSEfor an invalidstream_id.nice/libnice.sym: export the new symbol.No tests added: the existing suite has no coverage of the per-stream local-address API (only the agent-wide
nice_agent_add_local_addressis used intests/), so integration coverage is expected to live in the consuming layer.