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