[Nice] NiceAgent emits "candidate-gathering-done" before gathering is finished with UPnP

Jakub Adam jakub.adam at ktknet.cz
Sun Jul 11 01:51:40 PDT 2010


Hi,

when using libnice on a network with UPnP enabled router, I found something
that seems weird to me. Attached program demonstrates the problem, after
executing it I receive output like this:

$ ./nice-upnp
New a=candidate:1 1 UDP 2013266431 192.168.1.2 44909 typ host
New a=candidate:1 2 UDP 2013266430 192.168.1.2 60038 typ host
New a=candidate:2 1 UDP 1677721855 12.34.56.78 44909 typ srflx
Gathering done. List of local candidates:
-----------------------------------------
	a=candidate:1 1 UDP 2013266431 192.168.1.2 44909 typ host
	a=candidate:2 1 UDP 1677721855 12.34.56.78 44909 typ srflx
	a=candidate:1 2 UDP 2013266430 192.168.1.2 60038 typ host
-----------------------------------------
New a=candidate:2 2 UDP 1677721854 12.34.56.78 60038 typ srflx


As can be seen, the last candidate (or both candidates with foundation 2, depending
on conditions when program is run) is discovered AFTER "candidate-gathering-done"
signal is emitted, resulting in incomplete candidate list sent to remote peer.

Candidates with foundation 2 are discovered via UPnP. According to libnice documentation
i would expect that "candidate-gathering-done" emits when all attempts to gather
candidates has finished.

Is this behavior intentional?

This affects only candidate discovery with UPnP, when I set STUN server IP and port,
libnice acts normally and both server reflexive candidates are gathered before the
gathering done signal is emitted.

Thanks,
Jakub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nice-upnp.c
Type: text/x-csrc
Size: 2902 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/nice/attachments/20100711/4d0315d5/attachment.c>


More information about the Nice mailing list