<div dir="ltr"><div>Hi,<br></div><div><br></div><div>I'm not sure how it works as I hadn't implemented that part, but I'm guessing you need to call nice_agent_recv in order for it to receive the stun messages and discover the server reflexive and peer reflexive candidaets. I think you need to create a separate thread that will continuously call the function or something like that. Maybe have a look at how the GIO implementation works, it could give you ideas.</div>
<div><br></div><div>I hope this helps,</div><div>Youness.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 8:17 AM, Sudesh Kumar <span dir="ltr"><<a href="mailto:sudeshbks@gmail.com" target="_blank">sudeshbks@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have tried using the <span style="font-family:arial,sans-serif;font-size:13px">nice_agent_recv function in my code, but the problem is I have to use the peer reflexive candidate as my selected component. As per the function definition</span><div>

<span style="color:rgb(0,0,0);font-family:'Times New Roman'"><br></span></div><div><span style="color:rgb(0,0,0);font-family:'Times New Roman'">nice_agent_recv_messages </span><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">must not be used in combination with </span><a href="http://nice.freedesktop.org/libnice/NiceAgent.html#nice-agent-attach-recv" title="nice_agent_attach_recv ()" style="font-family:'Times New Roman';text-decoration:none;color:rgb(52,101,164);font-size:medium" target="_blank"><code>nice_agent_attach_recv()</code></a><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium"> on the same stream/component pair.</span><br>

</div><div><br></div><div>but I can get the peer reflexive candidates only if I <span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">attaches the </span><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">stream's component's sockets to the Glib Mainloop Context using </span><code style="color:rgb(52,101,164);font-family:'Times New Roman';text-decoration:none;font-size:medium"><a href="http://nice.freedesktop.org/libnice/NiceAgent.html#nice-agent-attach-recv" title="nice_agent_attach_recv ()" style="color:rgb(52,101,164);font-family:'Times New Roman';text-decoration:none;font-size:medium" target="_blank">nice_agent_attach_recv()</a> </code>before gathering the local candidates.</div>

<div><br></div><div>Please help me in advance on how to use the <span style="font-family:arial,sans-serif;font-size:13px">nice_agent_recv() function.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks & Regards,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Sudesh</span></div></div><div class="HOEnZb"><div class="h5">
<div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 7:12 PM, Sudesh Kumar <span dir="ltr"><<a href="mailto:sudeshbks@gmail.com" target="_blank">sudeshbks@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi,<div><br></div><div>I am new to libnice and I am able to execute the examples provided in the package. I can see the nice_agent_attach_recv function is used to read the data from connected peer in all the examples and this is a callback function. </div>


<div><br></div><div>I want to use the nice_agent_recv function instead of nice_agent_attach_recv, but I am unsure about how to use it. </div><div><br></div><div>Can u please provide me a sample code(possibly editing in simple-example.c) on how to use nice_agent_recv function.</div>


<div> </div><div>Thanks & Regards,</div><div>Sudesh</div></div>
</blockquote></div><br></div>
</div></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>