Aha!<br><br>I wasn&#39;t serializing the port number on NiceCandidate.addr and NiceCandidate.base_addr! I added that, as you suggested, and I&#39;m now sending data between my agents!<br><br><br>    td<br><br><div class="gmail_quote">
On Mon, Aug 30, 2010 at 3:24 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 08/30/2010 06:20 PM, Tony Di Croce wrote:<br>
&gt;<br>
&gt; Ok, well, I guess that&#39;s not my problem then!<br>
&gt;<br>
&gt; I feel like I&#39;m very close...<br>
&gt;<br>
&gt; I have two agents... both of which are getting their local candidates,<br>
&gt; serializing them and sendthing them to the other...<br>
&gt;<br>
&gt; Both of them are also sending their local credentials to each other and<br>
&gt; calling &quot;nice_agent_set_remote_credentials()&quot; on them...<br>
&gt;<br>
&gt; They are both talking to my stun server, and I believe that all of the<br>
&gt; information is being serialized and deserialized correctly (it&#39;s safe to<br>
&gt; use nice_address_to_string() and nice_address_set_from_string() to<br>
&gt; serialize and deserialize the NiceCandidate-&gt;addr and<br>
&gt; NiceCandidate-&gt;base_addr members right?)...<br>
</div>So far good, yes, you can serialize them with the to_string and from_string.<br>
Just don&#39;t forget to get/set the port on the NiceAddress.<br>
<div class="im">&gt;<br>
&gt; BTW, do I need to set the &quot;NiceCandidate-&gt;username&quot; and<br>
&gt; &quot;NiceCandidate-&gt;password&quot; fields if I am seperately sending the<br>
&gt; credentials ( I currently am both sending them as part of my<br>
&gt; NiceCandidate serialization process and seperately for calls to<br>
</div>&gt; set_remote_credentials())....?<br>
no, you don&#39;t need to.. some compatiblity modes (like google, or MSN) have a<br>
username/password different for each candidate, but that&#39;s from the old draft of<br>
ICE (draft 6) and it&#39;s not used anymore, now only the get/set credentials is<br>
needed. If you set a user/pass on the candidate itself, it will override the<br>
global stream credentials for that candidate.<br>
<div class="im"><br>
&gt;<br>
&gt; The behaviour that I&#39;m seeing is that my componet state never changes to<br>
&gt; 4... it goes right from 2 to 5... then a send() of course fails...<br>
</div>yes, 5 is FAILED, so something goes wrong.. if you run your program with the<br>
environment variable &quot;NICE_DEBUG=all&quot; set, and send me the logs from both sides<br>
for the same call, I&#39;ll have a look at see why it failed.<br>
You can send the logs to me directly in this case :)<br>
<br>
Youness.<br>
<div class="im">&gt;<br>
&gt;     td<br>
&gt;<br>
&gt; On Mon, Aug 30, 2010 at 2:47 PM, Youness Alaoui<br>
</div>&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;&gt;<br>
<div><div></div><div class="h5">&gt; wrote:<br>
&gt;<br>
&gt;     On 08/30/2010 05:43 PM, Tony Di Croce wrote:<br>
&gt;     &gt; In the &quot;test-thread.c&quot; example application that is included in the<br>
&gt;     &gt; libnice source tree a number of threads are created...<br>
&gt;     &gt;<br>
&gt;     &gt; My current thinking is that &quot;lthread&quot; and &quot;rthread&quot; are needed to<br>
&gt;     &gt; implement the main loop of the agents themselves... IE.. The threads<br>
&gt;     &gt; that execute the &quot;candidate-gathering-done&quot; etc signals...<br>
&gt;     &gt;<br>
&gt;     &gt; I&#39;m less sure about &quot;ldthread&quot; and &quot;rdthread&quot;..... These seem to<br>
&gt;     be used<br>
&gt;     &gt; when you&#39;re attaching a recv function... So I&#39;m guessing these are<br>
&gt;     &gt; internal worker threads that actually do the data transfer between<br>
&gt;     &gt; endpoints? If so, do you need a thread like this per stream or is one<br>
&gt;     &gt; worker thread for the whole agent sufficient?<br>
&gt;     &gt;<br>
&gt;     &gt;     td<br>
&gt;<br>
&gt;     No threads are needed, The test-thread.c example is for &quot;testing<br>
&gt;     threads&quot;, it&#39;s<br>
&gt;     there to make sure that even if libnice is being used by a<br>
&gt;     multi-threaded<br>
&gt;     environment, the library is thread-safe. It does not mean at all<br>
&gt;     that you need<br>
&gt;     to be using threads in order to make it work.. you only need one<br>
&gt;     thread, your<br>
&gt;     main one, the one where your main_loop is running, that&#39;s why you<br>
&gt;     give the<br>
&gt;     nice_agent_new the main_context to your mainloop, and that&#39;s why you<br>
&gt;     give it to<br>
&gt;     the nice_agent_attach_recv. That&#39;s all you need.<br>
&gt;<br>
&gt;     p.s: Please keep asking your questions on the mailing list.<br>
&gt;<br>
&gt;     Youness.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Nice mailing list<br>
&gt; <a href="mailto:Nice@lists.freedesktop.org">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>_______________________________________________<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>