hehe I think I can ask in Portuguese now, but then the discussion wouldn&#39;t be useful for many people<div><br></div><div>so, I tested Tiago&#39;s code, which ran fine if both peers are on the same machine. However, I started two peers, each under a different NAT (one at home and one at the lab) and exchanged the candidates and credentials files through scp in the middle of the execution (thanks to the getchar() call). However, I got the following output then:</div>
<div><br></div><div>&quot;left&quot; peer (lab):</div><div>==============================================</div><div><div>WAIT UNTIL YOU CHANGE FILES (when I did the scp exchange of cands and creds files)</div><div><br></div>
<div><br></div><div>READING CANDIDATES FROM FILE</div><div>READ 2 CANDIDATES FROM rightCands.bin.</div><div>PRINTING REMOTE CANDIDATES</div><div><br></div><div>CANDIDADE NUMBER 0:</div><div>  NICE_CANDIDATE_TYPE_HOST</div>
<div>  NICE_CANDIDATE_TRANSPORT_UDP</div><div><br></div><div>(process:62780): libnice-CRITICAL **: file address.c: line 259 (nice_address_to_string): should not be reached</div><div>  ADDRESS:  ?_?</div><div><br></div><div>
(process:62780): libnice-CRITICAL **: file address.c: line 259 (nice_address_to_string): should not be reached</div><div>  BASE ADDRESS:  ?_?</div><div>  PRIORITY: 2013266431</div><div>  STREAM_ID: 1</div><div>  COMPONENT_ID: 1</div>
<div>  FOUNDATION: 1</div><div>  USERNAME: (null)</div><div>  PASSWORD: (null)</div><div>CANDIDADE NUMBER 1:</div><div>  NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE</div><div>  NICE_CANDIDATE_TRANSPORT_UDP</div><div><br></div><div>
(process:62780): libnice-CRITICAL **: file address.c: line 259 (nice_address_to_string): should not be reached</div><div>  ADDRESS:  ?_?</div><div><br></div><div>(process:62780): libnice-CRITICAL **: file address.c: line 259 (nice_address_to_string): should not be reached</div>
<div>  BASE ADDRESS:  ?_?</div><div>  PRIORITY: 1677721855</div><div>  STREAM_ID: 1</div><div>  COMPONENT_ID: 1</div><div>  FOUNDATION: 2</div><div>  USERNAME: (null)</div><div>  PASSWORD: (null)</div><div>READING REMOTE CREDENTIALS FILE</div>
<div><br></div><div>READING CREDENTIALS FROM FILE rightCreds.bin</div><div>REMOTE USER: ZTS/</div><div>REMOTE PWD: 8j74ohw6S68cwn/B4CnSpw</div><div>(process:62780): libnice-DEBUG: Agent 0x10082e800: set_remote_candidates 1 1</div>
<div>**</div><div>ERROR:../client.c:210:cb_candidate_gathering_done: assertion failed: (nice_agent_set_remote_candidates(agent, stream_id, 1, remoteCands))</div><div>Abort trap</div><div>==============================================</div>
<div><br></div><div><br></div><div><br></div><div>right peer (home):</div><div>==============================================</div><div><div>WRITING LOCAL CREDENTIALS TO FILE rightCreds.bin</div><div>WAIT UNTIL YOU CHANGE FILES</div>
<div><br></div><div><br></div><div>READING CANDIDATES FROM FILE</div><div>READ 1 CANDIDATES FROM leftCands.bin.</div><div>PRINTING REMOTE CANDIDATES</div><div><br></div><div>CANDIDADE NUMBER 0:</div><div>  NICE_CANDIDATE_TYPE_HOST</div>
<div>  NICE_CANDIDATE_TRANSPORT_UDP</div><div><br></div><div>(process:25636): libnice-CRITICAL **: file address.c: line 259 (nice_address_to_string): should not be reached</div><div>  ADDRESS: </div><div><br></div><div>(process:25636): libnice-CRITICAL **: file address.c: line 259 (nice_address_to_string): should not be reached</div>
<div>  BASE ADDRESS: </div><div>  PRIORITY: 2013266431</div><div>  STREAM_ID: 1</div><div>  COMPONENT_ID: 1</div><div>  FOUNDATION: 1</div><div>  USERNAME: (null)</div><div>  PASSWORD: (null)</div><div>READING REMOTE CREDENTIALS FILE</div>
<div><br></div><div>READING CREDENTIALS FROM FILE leftCreds.bin</div><div>REMOTE USER: wnj6</div><div>REMOTE PWD: c5ufACXFyUowlh98uQoMBs</div><div>(process:25636): libnice-DEBUG: Agent 0x1689eb0: set_remote_candidates 1 1</div>
<div>**</div><div>ERROR:../client.c:210:cb_candidate_gathering_done: assertion failed: (nice_agent_set_remote_candidates(agent, stream_id, 1, remoteCands))</div><div>Abortado</div></div><div>==============================================</div>
<div><br></div><div><br></div><div><br></div><div>Any hints?</div><div><br></div><div><br></div><div>Eduardo</div>
<br><br><div class="gmail_quote">On Fri, Jan 13, 2012 at 10:38 AM, Tiago Sá <span dir="ltr">&lt;<a href="mailto:tiagosa@di.uminho.pt">tiagosa@di.uminho.pt</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>thanks Youness for sharing. My application has evolved into a more complex one, with some other features.</div><div>Anyway, if you need any explanation for these examples, I can do my best.</div><div>


<br></div><div>Regards,</div><div>Tiago Sá<div><div class="h5"><br><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 9:24 PM, Youness Alaoui <span dir="ltr">&lt;<a href="mailto:youness.alaoui@collabora.co.uk" target="_blank">youness.alaoui@collabora.co.uk</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It&#39;s a question that I get often. I hope to get some time to write a proper<br>
tutorial with some example code, in the meantime, I suggest reading old threads<br>
on this mailing list.<br>
Here is one thread specifically about starting with libnice which explains how<br>
to do, what the usual bugs/misconceptions are and some sample code is also shared :<br>
<a href="http://lists.freedesktop.org/archives/nice/2011-October/000442.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-October/000442.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-October/000443.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-October/000443.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-November/000449.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-November/000449.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-November/000451.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-November/000451.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-November/000456.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-November/000456.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-November/000458.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-November/000458.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-December/000467.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-December/000467.html</a><br>
<a href="http://lists.freedesktop.org/archives/nice/2011-December/000469.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-December/000469.html</a><br>
<br>
For some reason, the list archives doesn&#39;t save messages sent with the list as<br>
CC instead of TO.. so I don&#39;t have the messages from Tiago, but you can read<br>
them inlined in my own answers to him.<br>
In one of his mails he sent a sample program which I&#39;ve attached to this mail.<br>
It&#39;s a bit more complex than a simple &quot;libnice hello world&quot;, but it should give<br>
you an idea on how to use the API in a real life example.<br>
<br>
Let me know if you have any further questions.<br>
Youness.<br>
<div><br>
On 01/12/2012 11:49 AM, Eduardo Bezerra wrote:<br>
&gt; Oh and by the way, I&#39;ve seen the NiceAgent api page... Although that helped a<br>
&gt; lot in understand what idiomatic libnice uses, it doesn&#39;t really establish any<br>
&gt; &quot;connection&quot;...<br>
&gt;<br>
&gt; On Thu, Jan 12, 2012 at 5:47 PM, Eduardo Bezerra &lt;<a href="mailto:kdubezerra@gmail.com" target="_blank">kdubezerra@gmail.com</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:kdubezerra@gmail.com" target="_blank">kdubezerra@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi, I&#39;ve been studying libnice, and now also glib, since it&#39;s build on top<br>
&gt;     of it (it definitely feels much better than going with libevent, imho).<br>
&gt;     However, I still couldn&#39;t figure out what I have to do to make two peers<br>
&gt;     talk to each other.<br>
&gt;<br>
&gt;     Could you guys provide some (link to a) few-lines, minimalistic example<br>
&gt;     application that traverses the nat with ice and then communicates with some<br>
&gt;     other endpoint? Maybe something like<br>
&gt;     this? <a href="http://content.gpwiki.org/index.php/SDL:Tutorial:Using_SDL_net" target="_blank">http://content.gpwiki.org/index.php/SDL:Tutorial:Using_SDL_net</a><br>
&gt;<br>
&gt;     Thanks a lot again!<br>
&gt;<br>
&gt;     Eduardo<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; Nice mailing list<br>
&gt; <a href="mailto:Nice@lists.freedesktop.org" target="_blank">Nice@lists.freedesktop.org</a><br>
&gt; <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
<br>
<br>_______________________________________________<br>
Nice mailing list<br>
<a href="mailto:Nice@lists.freedesktop.org" target="_blank">Nice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Tiago Sá<br>Universidade do Minho, Braga - Portugal<div><img> <a href="http://www.tiagosa.com" target="_blank">www.tiagosa.com</a><br>


</div><br>
</font></span></div>
<br>_______________________________________________<br>
Nice mailing list<br>
<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
<br></blockquote></div><br></div>