[Nice] Bug: Gather candidates never completes

Tom Kaminski ttkaminski at gmail.com
Fri Aug 20 11:47:00 PDT 2010


I've came across a scenario where gather candidate done event never
gets triggered.

This happens if you disconnect one of your local network interfaces
interfaces after nice agent has added it to it's local_addresses list.
 The next time you try to gather candidates, it will issue the warning
in nice_agent_gather_candidates()

if (!host_candidate) {
        g_warning ("No host candidate??");
        return FALSE;
}

I changed it to

if (!host_candidate) {
        g_warning ("No host candidate??");
        continue;
}

To fix this problem.


Better yet, I think libnice should also repopulate it's
agent->local_addresses list everytime nice_agent_gather_candidates()
is called (in the case where the local addresses haven't been manually
set).

On a different note, is it safe to decrease the STUN_END_TIMEOUT value
in timer.c?  It is painfully long (causing people to complain).  We
had a previous discussion on this mail list about this timeout and the
possibility of only performing stun discovery on the interfaces of
interest (ie. the interfaces that are known to not timeout).  My idea
was to find out which interface is being used to connect to my public
server via tcp, but apparently the OS doesn't really provide
information on which interface is being used by a given socket.  Any
thoughts on this timeout issue would be appreciated.

I was also wondering if anyone has advice/recommendations what's the
best way to use libnice with a router that has port forwarding enabled
for a range of UDP ports.  My understanding is that by setting up port
forwarding will increase the likelihood that connection establishment
will succeed (especially for routers that do not work with the
existing NAT punchthrough method used by libnice).

Thanks,
Tom


More information about the Nice mailing list