Hi Youness,<div><br></div><div>Sure! I will share the application when I succeed.</div><div>Before trying to pipe from a local socket I am simply testing reading from a file and sending that data to the other agent.</div><div>

I am using nice_agent_new_reliable and pseudo_tcp is opened:</div><div>&quot;(process:11881): libnice-DEBUG: Agent 0xb97de0: s1:1 pseudo Tcp socket Opened&quot;</div><div>Can I assume that Nice will manage the acknowledgments, sequencing and all that TCP stuff?</div>

<div><br></div><div>This is the function I use to slice and send the file:</div><div><br></div><div><div><font class="Apple-style-span" size="1">int send_file(char *filename){</font></div><div><font class="Apple-style-span" size="1">        FILE *file = fopen(filename, &quot;rb&quot;);</font></div>

<div><font class="Apple-style-span" size="1">        char *file_chunk = malloc(CHUNK_SIZE);</font></div><div><font class="Apple-style-span" size="1"><br></font></div><div><font class="Apple-style-span" size="1">        size_t nbytes = 0;</font></div>

<div><font class="Apple-style-span" size="1">        int sent=0;</font></div><div><font class="Apple-style-span" size="1">        while ( (nbytes = fread(file_chunk, sizeof(char), CHUNK_SIZE,file)) &gt; 0)</font></div><div>

<font class="Apple-style-span" size="1">        {</font></div><div><font class="Apple-style-span" size="1">                int offset = 0;</font></div><div><font class="Apple-style-span" size="1">                while (((sent = nice_agent_send(agent,stream_id,NICE_COMPONENT_TYPE_RTP,nbytes,fi</font></div>

<div><font class="Apple-style-span" size="1">le_chunk+offset)) &gt; 0) || (sent == -1 &amp;&amp; errno == EINTR) ) {</font></div><div><font class="Apple-style-span" size="1">                        if (sent &gt; 0) {</font></div>

<div><font class="Apple-style-span" size="1">                                printf(&quot;SENT FILE: chunk size: %zu send result: %d \n&quot;,nbytes,sent);</font></div><div><font class="Apple-style-span" size="1">                                offset += sent;</font></div>

<div><font class="Apple-style-span" size="1">                                nbytes -= sent;</font></div><div><font class="Apple-style-span" size="1">                        }</font></div><div><font class="Apple-style-span" size="1">                }</font></div>

<div><font class="Apple-style-span" size="1">        }</font></div><div><font class="Apple-style-span" size="1">        return 0;</font></div><div><font class="Apple-style-span" size="1">}</font></div></div><div><font class="Apple-style-span" size="1"><br>

</font></div><div>And the callback to receive:</div><div><font class="Apple-style-span" size="1"><br></font></div><div><font class="Apple-style-span" size="1"><div>void</div><div>cb_nice_recv (NiceAgent * agent, guint stream_id, guint component_id,</div>

<div>              guint len, gchar * buf, gpointer user_data)</div><div>{</div></font><span class="Apple-style-span" style="font-size:x-small">  FILE *file_received=fopen(&quot;testFile-received.txt&quot;, &quot;ab&quot;);</span><font class="Apple-style-span" size="1"><div>

 </div><div>  if(file_received){</div></font><span class="Apple-style-span" style="font-size:x-small">      int writen = fwrite(buf,sizeof(char),len,file_received);</span></div><div><font class="Apple-style-span" size="1"></font><span class="Apple-style-span" style="font-size:x-small">     printf(&quot;RECEIVED FILE: buf size: %d , writen size: %d\n\n&quot;,len,writen);</span><font class="Apple-style-span" size="1"><div>

  }</div><div>  else{ perror(&quot;ERROR OPENING FILE\n&quot;); }</div><div>}</div></font></div><div><br></div><div>It sends some chunks and then starts to fail on send.</div><div><br></div><div>Problably I should use the &quot;reliable-transport-writable&quot; signal, to wait before trying to send a new chunk, but then, the signal must be handled by a different callback, am I write? Or can I &quot;wait&quot; for the signal on the same send_file function?</div>

<div><br></div><div>Thank you for the helpful information you are sharing.</div><div><br></div><div>Cheers,</div><div>Tiago Sá</div><div><br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 11:39 PM, Youness Alaoui <span dir="ltr">&lt;<a href="mailto:youness.alaoui@collabora.co.uk">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">On 12/12/2011 06:20 AM, Tiago Sá wrote:<br>
&gt; Hi again Youness,<br>
Hi again Tiago,<br>
<div class="im"><br>
&gt;<br>
&gt; my application is progressing in small steps.<br>
&gt; We chose to use XMPP for the communication. We are using libstrophe, it lacks<br>
&gt; some documentation, but was enough for our needs.<br>
&gt; We implemented a naif handshake, life the one you mentioned above, by exchanging<br>
&gt; some xmpp message stanzas.<br>
<br>
</div>Cool, you may want to look at the jingle XEP to see how candidates are being<br>
transferred in a VoIP call.<br>
<div class="im"><br>
&gt;<br>
&gt; This application will be part of a research project involving the grid, where we<br>
&gt; need private hosts (called agents) to be able to communicate someway. We will<br>
&gt; implement that (inter-agent) communication protocol later, right now we are<br>
&gt; concerned with the NAT traversal thing, and it seems to be working fine :)<br>
&gt;<br>
&gt; Now, I would like to ask you a final question:<br>
&gt; Right now we are able to send strings using &quot;nice_agent_send&quot;. We would like to<br>
&gt; establish a socket between the hosts and use other common primitives to code our<br>
&gt; application.<br>
&gt; Maybe the best possibility would be to create some kind of pipe from an<br>
&gt; &quot;external&quot; application using local ports (something<br>
&gt; like <a href="http://code.google.com/p/gnat/" target="_blank">http://code.google.com/p/gnat/</a>)<br>
&gt; Or, in a simpler way, just pipe stdin/stdout from another app, slice that data<br>
&gt; and send it using libnice send primitive?<br>
&gt;<br>
&gt; Have you ever tried something like this?<br>
</div>I have not tried something like that, but it shouldn&#39;t be too hard in my<br>
opinion. You could just create a local daemon that connects to the XMPP server,<br>
and when it gets a new local connection, it sends candidates and acts as a proxy<br>
between the <a href="http://127.0.0.1:12345" target="_blank">127.0.0.1:12345</a> socket and the remote socket with the<br>
nice_agent_send and the recv callback.<br>
Would be nice if that code gets shared if you ever get to do it. But I don&#39;t see<br>
anything that would prevent it from working.<br>
Good luck!<br>
<div class="im">&gt;<br>
&gt; Thank you very much for your help.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Tiago<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Nov 28, 2011 at 12:46 PM, Youness Alaoui &lt;<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
</div><div><div class="h5">&gt; &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 11/23/2011 01:14 PM, Tiago Sá wrote:<br>
&gt;     &gt; Hi Youness,<br>
&gt;     &gt;<br>
&gt;     &gt; thank you for your suggestions.<br>
&gt;     &gt; You&#39;r right, the STUN/TURN server I was using had a connection limit. I<br>
&gt;     &gt; installed the <a href="http://turnserver.org" target="_blank">turnserver.org</a> &lt;<a href="http://turnserver.org" target="_blank">http://turnserver.org</a>&gt;<br>
&gt;     &lt;<a href="http://turnserver.org" target="_blank">http://turnserver.org</a>&gt; one in a public addressed<br>
&gt;     &gt; machine.<br>
&gt;     &gt; I also changed the way how I was writing the candidates, setting those<br>
&gt;     pointers<br>
&gt;     &gt; to NULL.<br>
&gt;     &gt; ICE seems to be working properly now! :)<br>
&gt;     Glad it worked :)<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; I have a question:<br>
&gt;     &gt; According to the example in <a href="http://nice.freedesktop.org/libnice/NiceAgent.html" target="_blank">http://nice.freedesktop.org/libnice/NiceAgent.html</a><br>
&gt;     &gt; we should be able to start sending messages after the signal new-selected-pair<br>
&gt;     &gt; is fired. However, I tried it but no success:<br>
&gt;     &gt; void<br>
&gt;     &gt; cb_new_selected_pair (void)<br>
&gt;     &gt; {<br>
&gt;     &gt;   printf (&quot;cb_new_selected_pair\n&quot;);<br>
&gt;     &gt;   nice_agent_send(agent, stream_id, NICE_COMPONENT_TYPE_RTP,<br>
&gt;     strlen(&quot;Ola&quot;),&quot;Ola&quot;);<br>
&gt;     &gt; }<br>
&gt;     &gt;<br>
&gt;     &gt; That first message is never received. However, after &quot;a while&quot; I try to send<br>
&gt;     &gt; again and it works. Do I have to wait for the other agent to be ready to<br>
&gt;     receive?<br>
&gt;     Humm.. that might not have been entirely true.. technically if there is a<br>
&gt;     selected pair, then it should work, unless you are ready locally, but the remote<br>
&gt;     isn&#39;t ready to receive yet. technically you should wait for the state to go to<br>
&gt;     READY... and not care about the selected pair.. the docs might be wrong there,<br>
&gt;     but it&#39;s been a while and I&#39;m not entirely sure of the use case that would make<br>
&gt;     it fail (but in every other project, we use the READY state as an indication<br>
&gt;     that we&#39;re ready to send).<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Well, this is a checkpoint for me, but I must ask for another suggestion now.<br>
&gt;     &gt; I need to improve the way how the communication between agents is made<br>
&gt;     &gt; (exchanging candidates/credentials, initiating p2p connections, etc...)<br>
&gt;     &gt; As I read in this<br>
&gt;     &gt; thread <a href="http://lists.freedesktop.org/archives/nice/2010-August/000330.html" target="_blank">http://lists.freedesktop.org/archives/nice/2010-August/000330.html</a><br>
&gt;     , you<br>
&gt;     &gt; wrote:<br>
&gt;     &gt; &quot;well, the serialization, if I understand what you mean, is how you send the<br>
&gt;     &gt; candidates to the other side, right ? In that case, that&#39;s not part of the ICE<br>
&gt;     &gt; methodology.. you can &#39;serialize&#39; the candidates/user/pass any way you want..<br>
&gt;     &gt; one method is to put it in the SDP of a SIP invite. You can also send it as an<br>
&gt;     &gt; XML using Jingle&#39;s XEP over an XMPP connection.. it really all depends on what<br>
&gt;     &gt; protocol is being used to connect to the server (SIP, XMPP, custom, other...).<br>
&gt;     &gt; I&#39;ll let you decide on the best way to do that.&quot;<br>
&gt;     Thanks for searching in the archives :)<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; After doing some research, I feel a bit scared. That is a completely new world<br>
&gt;     &gt; for me. Could you please point the &quot;simplest and most feasible&quot; solution for<br>
&gt;     &gt; this problem? Should I choose SIP or XMPP?<br>
&gt;     &gt; libjingle, for example, presents a huge API...<br>
&gt;     &gt; Do you know any simple client, possibly allowing me to connect to an existing<br>
&gt;     &gt; infrastructure (such as Google Talk), I could use for this trivial information<br>
&gt;     &gt; exchange?<br>
&gt;<br>
&gt;     Humm.. yes, libjingle is a big pile of **** :) my suggestion is to never use it!<br>
&gt;     The real question here is what do you need libnice for? what will the clients be<br>
&gt;     ? if it&#39;s for a game or some custom application and that you can control the<br>
&gt;     server and the client, then you can setup something custom. If you want to have<br>
&gt;     a list of contacts in your application and the user can just select one and it<br>
&gt;     will know what to do, then using XMPP might be the best solution. It really all<br>
&gt;     depends on your needs and capabilities.. you can decide all about it, but here&#39;s<br>
&gt;     a simple example if you want :<br>
&gt;     client sending to server is : ---&gt;<br>
&gt;     client receiving from server is : &lt;-----<br>
&gt;     Comments are preceded with #<br>
&gt;     ----&gt; HELLO<br>
&gt;     &lt;---- HELLO 12345 # Where 12345 would be a random id that gets assigned to you<br>
&gt;     ----&gt; 54321 BEGIN ICE # first number being the &#39;random id&#39; of the destination<br>
&gt;     ----&gt; 54321 ICE-CREDENTIALS &lt;the_username&gt; &lt;the_password&gt;<br>
&gt;     ----&gt; 54321 CANDIDATE 1 UDP 192.168.1.100 43132 host<br>
&gt;     ----&gt; 54321 CANDIDATE 2 UDP 1.2.3.4 52133 srv-reflx<br>
&gt;     ----&gt; 54321 ICE DONE # To say you&#39;re done, you can send it to the peer<br>
&gt;     &lt;---- 54321 ICE REPLY<br>
&gt;     &lt;---- 54321 ICE-CREDENTIALS foo bar # the remote&#39;s credentials<br>
&gt;     &lt;---- 54321 CANDIDATE 1 UDP  192.168.1.200 54521 host<br>
&gt;     &lt;---- 54321 CANDIDATE 2 UDP 1.2.4.1 9614 srv-reflx<br>
</div></div>&gt;     &lt;---- 54321 CANDIDATE 3 UDP <a href="tel:4.3.2.1%2032957" value="+351432132957">4.3.2.1 32957</a> &lt;tel:4.3.2.1%2032957&gt; relay-reflx<br>
<div class="im HOEnZb">&gt;     &lt;---- 54321 ICE DONE<br>
&gt;     [...]<br>
&gt;     ----&gt; 54321 ICE DESTROY<br>
&gt;<br>
&gt;     And your server just maps sockets with those random ids, and relays the data<br>
&gt;     from one socket to another. And you parse the received input and build your<br>
&gt;     candidates...<br>
&gt;     So this is a very simple, but of course inefficient, you get a random id<br>
&gt;     everytime, it&#39;s hard to improve the protocol, etc... so using XMPP would be<br>
&gt;     better, but if you really don&#39;t need that much, then this might be the solution<br>
&gt;     you want.. like I said, it really depends on what you need it for.<br>
&gt;     As for XMPP, you can look at the &#39;wocky&#39; library<br>
&gt;     (<a href="http://cgit.freedesktop.org/wocky/" target="_blank">http://cgit.freedesktop.org/wocky/</a>)<br>
&gt;<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Thank you for your help.<br>
&gt;     You&#39;re welcome :)<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Regards,<br>
&gt;     &gt; Tiago Sá<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; On Thu, Nov 17, 2011 at 9:42 PM, Youness Alaoui<br>
&gt;     &lt;<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a> &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
</div><div class="HOEnZb"><div class="h5">&gt;     &gt; &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     On 11/16/2011 08:30 PM, Tiago Sá wrote:<br>
&gt;     &gt;     &gt; Hi again Youness,<br>
&gt;     &gt;     &gt; thanks a lot for your help.<br>
&gt;     &gt;     &gt; I believe I solved the problems you pointed before.<br>
&gt;     &gt;     &gt; I am using a dumb method to exchange candidates. I write them to<br>
&gt;     file and<br>
&gt;     &gt;     &gt; exchange them using a ftp server (I will improve it later).<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; So, the way I run it is:<br>
&gt;     &gt;     &gt; (HostA) ./client l<br>
&gt;     &gt;     &gt; (HostB) ./client r<br>
&gt;     &gt;     &gt; //local candidates are gathered and written to file<br>
&gt;     &gt;     &gt; (HostA) put leftCands.bin on FTP and get rightCands.bin<br>
&gt;     &gt;     &gt; (HostB) put rightCands.bin on FTP and get leftCands.bin<br>
&gt;     &gt;     &gt; //read local credentials and write them on the remote host<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; I am using a relay server, that should work as a last resort. But<br>
&gt;     during the<br>
&gt;     &gt;     &gt; local candidate gathering, sometimes it gets a relayed candidate,<br>
&gt;     but most of<br>
&gt;     &gt;     &gt; the times it doesn&#39;t. Can it be related with timeouts?<br>
&gt;     &gt;     It&#39;s possible the timeouts are affecting it, but I doubt it, usually<br>
&gt;     the RTT<br>
&gt;     &gt;     would be 200ms, but if you don&#39;t get a response from the relay or the stun<br>
&gt;     &gt;     server, it will retry 4 times until it times out after about 3 seconds.<br>
&gt;     &gt;     It&#39;s possible though that the server has a limit on the number of<br>
&gt;     allocations<br>
&gt;     &gt;     you can create (probably 5) and if you are testing your app and it<br>
&gt;     creates 2<br>
&gt;     &gt;     allocations each time (one for each side), then it&#39;s possible the<br>
&gt;     server starts<br>
&gt;     &gt;     rejecting your allocation requests (each time you want to use TURN, it<br>
&gt;     will ask<br>
&gt;     &gt;     the server to allocate a port for you for that specific connection, so<br>
&gt;     you have<br>
&gt;     &gt;     the same settings but one port for each stream/component).<br>
&gt;     &gt;     If that&#39;s the case, maybe that&#39;s why it sometimes works (when the<br>
&gt;     allocation<br>
&gt;     &gt;     times out from the server). libnice should technically deallocate when the<br>
&gt;     &gt;     stream is destroyed, so maybe catch your Ctrl-C and do an unref on the<br>
&gt;     agent<br>
&gt;     &gt;     before returning from the main.<br>
&gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Either way, it can never get a pair a establish a connection. :(<br>
&gt;     &gt;     &gt; I don&#39;t have a clue why this happens..<br>
&gt;     &gt;<br>
&gt;     &gt;     A log + wireshark dump might be helpful in this case. You can enable<br>
&gt;     logging<br>
&gt;     &gt;     with :<br>
&gt;     &gt;     export NICE_DEBUG=all<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Can you please have a look?<br>
&gt;     &gt;     The code looks sane enough.. apart from the obvious method of exchanging<br>
&gt;     &gt;     candidates which isn&#39;t &quot;optimal&quot;. One thing I noticed though, you just<br>
&gt;     fwrite<br>
&gt;     &gt;     the whole structure, but note that there are pointers in the structure<br>
&gt;     that will<br>
&gt;     &gt;     be written as is to the file, and not their content. I&#39;m thinking of<br>
&gt;     &gt;     username+password (but those should be NULL if you use the RFC5245<br>
&gt;     compatibility<br>
&gt;     &gt;     mode) but mostly the turn structure (which is just for local<br>
&gt;     candidates and<br>
&gt;     &gt;     wouldn&#39;t be used anyways for remote ones, but it&#39;s best to set it to<br>
&gt;     NULL to<br>
&gt;     &gt;     avoid possible crashes).<br>
&gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Cheers,<br>
&gt;     &gt;     &gt; Tiago<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; On Fri, Nov 4, 2011 at 2:03 PM, Youness Alaoui<br>
&gt;     &gt;     &lt;<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a> &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt;     &gt;     &gt; &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     Hi again Tiago,<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     For the remote candidates, you will need a third party server to<br>
&gt;     &gt;     exchange that<br>
&gt;     &gt;     &gt;     information, usually the candidates would be sent over SIP or<br>
&gt;     XMPP for<br>
&gt;     &gt;     example.<br>
&gt;     &gt;     &gt;     ICE cannot work if you don&#39;t have a third party server with<br>
&gt;     which you can<br>
&gt;     &gt;     &gt;     reliably exchange candidates. For testing purposes you could have it<br>
&gt;     &gt;     print the<br>
&gt;     &gt;     &gt;     candidates to stdout, and you could copy/paste that into stdin<br>
&gt;     of the<br>
&gt;     &gt;     other<br>
&gt;     &gt;     &gt;     instance and have it parse the input.. or you could hardcode a<br>
&gt;     port to<br>
&gt;     &gt;     connect<br>
&gt;     &gt;     &gt;     to and do the candidate exchange.. there&#39;s no easy way of doing that<br>
&gt;     &gt;     though.<br>
&gt;     &gt;     &gt;     You cannot hardcode the candidates because the port used will be<br>
&gt;     random<br>
&gt;     &gt;     &gt;     everytime, also, you will need to exchange the randomly generated<br>
&gt;     &gt;     &gt;     username/password (nice_agent_get_local_credentials +<br>
&gt;     &gt;     &gt;     nice_agent_set_remote_credentials) to make the connectivity<br>
&gt;     checks work.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     As for your example, here are a few comments :<br>
&gt;     &gt;     &gt;     1 - you call the nice_agent_set_relay_info with stream_id being<br>
&gt;     &gt;     uninitialized,<br>
&gt;     &gt;     &gt;     you must call it *after* you do the nice_agent_add_stream...<br>
&gt;     &gt;     &gt;     2 - you don&#39;t need those GValues, you can just do<br>
&gt;     &gt;     &gt;      g_object_set (G_OBJECT(agent),<br>
&gt;     &gt;     &gt;                    &quot;stun-server&quot;, &quot;66.228.45.110&quot;,<br>
&gt;     &gt;     &gt;                    &quot;stun-server-port&quot;, 3478,<br>
&gt;     &gt;     &gt;                     NULL);<br>
&gt;     &gt;     &gt;     3 - You shouldn&#39;t set the remote credentials as the same as the<br>
&gt;     local ones<br>
&gt;     &gt;     &gt;     4 - In your print_candidate_info, you may also want to print the<br>
&gt;     port<br>
&gt;     &gt;     used.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     I hope this helps, let me know if you have further questions.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     Youness.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     On 11/03/2011 12:57 PM, Tiago Sá wrote:<br>
&gt;     &gt;     &gt;     &gt; Hi Youness,<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; I have been trying to create a simple application based on the<br>
&gt;     first<br>
&gt;     &gt;     link you<br>
&gt;     &gt;     &gt;     &gt; pointed before.<br>
&gt;     &gt;     &gt;     &gt; Thanks for the tips you gave me. I have a couple of questions<br>
&gt;     though, if<br>
&gt;     &gt;     &gt;     you can<br>
&gt;     &gt;     &gt;     &gt; help me.<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; I need to find a way to get the remote candidates passed from<br>
&gt;     a peer to<br>
&gt;     &gt;     &gt;     another.<br>
&gt;     &gt;     &gt;     &gt; Can you point an easy way to do that?<br>
&gt;     &gt;     &gt;     &gt; Could I hardcode the remote candidates list, for testing purposes?<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; Right now, I only get two local candidates (HOST and<br>
&gt;     SERVER_REFLEXIVE).<br>
&gt;     &gt;     &gt;     &gt; I am trying to use the numb TURN server, shouldn&#39;t I get a RELAYED<br>
&gt;     &gt;     &gt;     candidate too?<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; I am attaching the code. Can you please have a look at the<br>
&gt;     code and<br>
&gt;     &gt;     check<br>
&gt;     &gt;     &gt;     where<br>
&gt;     &gt;     &gt;     &gt; the error could be?<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; Thanks for helping!<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; Regards,<br>
&gt;     &gt;     &gt;     &gt; Tiago Sá<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; On Wed, Oct 19, 2011 at 10:53 PM, Youness Alaoui<br>
&gt;     &gt;     &gt;     &lt;<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a> &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;&gt;<br>
&gt;     &gt;     &gt;     &gt; &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;<br>
&gt;     &gt;     &gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a><br>
&gt;     &lt;mailto:<a href="mailto:youness.alaoui@collabora.co.uk">youness.alaoui@collabora.co.uk</a>&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     Hi,<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     Welcome to the world of libnice :)<br>
&gt;     &gt;     &gt;     &gt;     Yes, doing NAT traversal is far from being easy, the only<br>
&gt;     &gt;     solution is<br>
&gt;     &gt;     &gt;     pretty<br>
&gt;     &gt;     &gt;     &gt;     much to use the ICE specification and that&#39;s not easy to<br>
&gt;     &gt;     implement, so<br>
&gt;     &gt;     &gt;     that&#39;s<br>
&gt;     &gt;     &gt;     &gt;     why you&#39;d need to use libnice.<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     For an example, you can have a look at the unit tests, like<br>
&gt;     &gt;     &gt;     &gt;     tests/test-fullmode.c for example, although that does a lot of<br>
&gt;     &gt;     stuff.<br>
&gt;     &gt;     &gt;     You can<br>
&gt;     &gt;     &gt;     &gt;     see a quick example  in the documentation for NiceAgent :<br>
&gt;     &gt;     &gt;     &gt;     <a href="http://nice.freedesktop.org/libnice/NiceAgent.html" target="_blank">http://nice.freedesktop.org/libnice/NiceAgent.html</a><br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     For smaller examples, you can look at the libnice mailing list<br>
&gt;     &gt;     &gt;     archives, some<br>
&gt;     &gt;     &gt;     &gt;     people posted their example code where they were having<br>
&gt;     &gt;     problems. For<br>
&gt;     &gt;     &gt;     example, a<br>
&gt;     &gt;     &gt;     &gt;     very simple example can be seen here :<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     <a href="http://lists.freedesktop.org/archives/nice/2011-January/000404.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-January/000404.html</a><br>
&gt;     &gt;     &gt;     &gt;     But make sure to click on the &quot;Next message&quot; to read the whole<br>
&gt;     &gt;     thread<br>
&gt;     &gt;     &gt;     because<br>
&gt;     &gt;     &gt;     &gt;     that example had a bug that I explained how to fix in the<br>
&gt;     following<br>
&gt;     &gt;     &gt;     emails.<br>
&gt;     &gt;     &gt;     &gt;     Same for this thread :<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     <a href="http://lists.freedesktop.org/archives/nice/2011-October/000434.html" target="_blank">http://lists.freedesktop.org/archives/nice/2011-October/000434.html</a><br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     I hope that helps,<br>
&gt;     &gt;     &gt;     &gt;     Youness.<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     On 10/19/2011 09:58 AM, Tiago Sá wrote:<br>
&gt;     &gt;     &gt;     &gt;     &gt; Hi all,<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; my name is Tiago Sá, I am a junior researcher from Portugal<br>
&gt;     &gt;     and this<br>
&gt;     &gt;     &gt;     is my<br>
&gt;     &gt;     &gt;     &gt;     first<br>
&gt;     &gt;     &gt;     &gt;     &gt; mail to this list.<br>
&gt;     &gt;     &gt;     &gt;     &gt; I have a NAT traversal problem to solve and I have been<br>
&gt;     &gt;     looking for<br>
&gt;     &gt;     &gt;     a solution<br>
&gt;     &gt;     &gt;     &gt;     &gt; during the last weeks, which, as I found out, is not so<br>
&gt;     &gt;     trivial as I<br>
&gt;     &gt;     &gt;     &gt;     thought before.<br>
&gt;     &gt;     &gt;     &gt;     &gt; As stated on the libnice homepage, libnice seems to be<br>
&gt;     what I am<br>
&gt;     &gt;     &gt;     looking for:<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt;     &quot;ICE is useful for applications that want to establish<br>
&gt;     &gt;     peer-to-peer<br>
&gt;     &gt;     &gt;     &gt;     UDP data<br>
&gt;     &gt;     &gt;     &gt;     &gt;     streams. It automates the process of traversing NATs and<br>
&gt;     &gt;     &gt;     provides security<br>
&gt;     &gt;     &gt;     &gt;     &gt;     against some attacks. It also allows applications to<br>
&gt;     &gt;     create reliable<br>
&gt;     &gt;     &gt;     &gt;     streams<br>
&gt;     &gt;     &gt;     &gt;     &gt;     using a TCP over UDP layer.&quot;<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; I have been looking for the provided documentation and I am<br>
&gt;     &gt;     feeling kind<br>
&gt;     &gt;     &gt;     &gt;     of lost.<br>
&gt;     &gt;     &gt;     &gt;     &gt; Is there any example application or tutorial to get started?<br>
&gt;     &gt;     &gt;     &gt;     &gt; Could you please share a basic application of this kind or<br>
&gt;     &gt;     point me a<br>
&gt;     &gt;     &gt;     &gt;     direction?<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; Thanks in advance for your help.<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; Regards,<br>
&gt;     &gt;     &gt;     &gt;     &gt; Tiago Sá<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; --<br>
&gt;     &gt;     &gt;     &gt;     &gt; Tiago Sá<br>
&gt;     &gt;     &gt;     &gt;     &gt; Universidade do Minho, Braga - Portugal<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt;  <a href="http://about.me/tiagosa/" target="_blank">http://about.me/tiagosa/</a><br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; _______________________________________________<br>
&gt;     &gt;     &gt;     &gt;     &gt; Nice mailing list<br>
&gt;     &gt;     &gt;     &gt;     &gt; <a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt; &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;&gt;<br>
&gt;     &gt;     &gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt; &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;&gt;&gt;<br>
&gt;     &gt;     &gt;     &gt;     &gt; <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;     _______________________________________________<br>
&gt;     &gt;     &gt;     &gt;     Nice mailing list<br>
&gt;     &gt;     &gt;     &gt;     <a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt; &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;&gt;<br>
&gt;     &gt;     &gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt; &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a> &lt;mailto:<a href="mailto:Nice@lists.freedesktop.org">Nice@lists.freedesktop.org</a>&gt;&gt;&gt;&gt;<br>
&gt;     &gt;     &gt;     &gt;     <a href="http://lists.freedesktop.org/mailman/listinfo/nice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/nice</a><br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; --<br>
&gt;     &gt;     &gt;     &gt; Tiago Sá<br>
&gt;     &gt;     &gt;     &gt; Universidade do Minho, Braga - Portugal<br>
&gt;     &gt;     &gt;     &gt;  <a href="http://www.tiagosa.com" target="_blank">www.tiagosa.com</a> &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>
&gt;     &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt; &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>
&gt;     &gt;     &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; --<br>
&gt;     &gt;     &gt; Tiago Sá<br>
&gt;     &gt;     &gt; Universidade do Minho, Braga - Portugal<br>
&gt;     &gt;     &gt;  <a href="http://www.tiagosa.com" target="_blank">www.tiagosa.com</a> &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt; &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>


&gt;     &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; --<br>
&gt;     &gt; Tiago Sá<br>
&gt;     &gt; Universidade do Minho, Braga - Portugal<br>
&gt;     &gt;  <a href="http://www.tiagosa.com" target="_blank">www.tiagosa.com</a> &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt; &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>


&gt;     &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Tiago Sá<br>
&gt; Universidade do Minho, Braga - Portugal<br>
&gt;  <a href="http://www.tiagosa.com" target="_blank">www.tiagosa.com</a> &lt;<a href="http://www.tiagosa.com" target="_blank">http://www.tiagosa.com</a>&gt;<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Tiago Sá<br>Universidade do Minho, Braga - Portugal<div><img src="http://wac.2659.edgecastcdn.net/802659/production80/images/icons/favicon.ico"> <a href="http://www.tiagosa.com" target="_blank">www.tiagosa.com</a><br>

</div><br>
</div>