[Nice] Using libnice address candidates with normal C sockets

Daniel Lobo dlobo at student.dei.uc.pt
Mon Apr 15 04:43:30 PDT 2013


I'm working with C sockets and currently have "peers" connecting to each
other in the same machine, without using libnice at all. Now, I want to
make this system work when peers are in different networks and behind NATs,
taking advantage of P2P.

My main question is: can I use libnice to find me the peer connection
endpoints and then use those addresses with a normal socket (both listening
at/connecting to that address)?

I more or less did this, but only because the peers were all in the same
machine and addresses were all from my network/machine. Is this possible
when in different networks? (I'm sorry for asking but I can't test it with
my current test environment...)

The recent libnice examples (simple-example.c) certainly do not use normal
C sockets, and I fear I cannot fully comprehend what is going on. I believe
that the candidates might be "any" used address from one machine to the
other, going through routers, but, if that is so, how can I bind a socket
to one of the local addresses which are outside my network? Does it work?
(again, I can't currently test it) What does libnice itself do to
bind/connect when linking the two peers? Can we access the information it
uses and do the same?

I apologize for all the questions, but they are closely related, I think :)

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20130415/d18ec994/attachment.html>

More information about the nice mailing list