[Nice] public API to get selected pair
ballen at ci.uchicago.edu
Tue Jan 22 15:24:59 PST 2013
Thanks for the quick reply, comments inline.
On Tue, 22 Jan 2013 17:38:18 -0500
Olivier Crête <olivier.crete at collabora.com> wrote:
> On Tue, 2013-01-22 at 16:03 -0600, Bryce Allen wrote:
> > I notice that there is nice_agent_set_selected_pair, but not
> > get_selected_pair.
> You can listen to the "new-selected-pair" signal, it will tell you
> which candidates have been selected.. But I agree it would be good to
> add such an API for completeness.
The signal gives you the foundations - it wasn't immediately obvious to
me that the foundation would uniquely identify the candidate, but it
does appear to be the case looking at the internal code. So I just need
to iterate over nice_get_remote_candidates and
nice_get_remote_candidates, doing strncmp on the foundations until I
find the match for each?
> > If I can get the selected pair, I can destroy NiceAgent and
> > immediately bind to the local base address and send to remote,
> > before any intermediate firewall sessions timeout. UDT sends
> > frequent keep alives so once the application takes over the
> > bindings will be maintained.
> Are you aware that the libnice reliable mode is not TCP, but a custom
> TCP-over-UDP implementation (that is compatible with the one used by
> Google Talk). And it's definitely not compatible with UDT, which is a
> completely different protocol. So you need to be using libnice on both
> sides (or libjingle) to send and receive. Alternatively, you could try
> to put libnice below UDT, but I'm not sure how the UDT code works.
> Also, if you end up using a TURN relay, you need to send through
> libnice, as the packets are encapsulated.
Our current plan for relay is very application specific, so we would
not be using TURN anyway. Using libnice reliable is technically
possible, just extra work since we already have a UDT implementation.
Much simpler for us to use libnice to negotiate the addresses, then stop
the agent and give control to UDT.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 490 bytes
Desc: not available
More information about the nice