<div dir="ltr">Hi,<div><br></div><div>Is there any example code of the simplest use case with <span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">nice_agent_recv()? Like your example-simple in tree?</span></div><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">I've seen your articlethat says that </span><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">nice_agent_recv() should be the one used in production, yet I can't find</span></div><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">any example of peer wotking with this.</span></div><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">Kind regards,</span></div><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">Radosław Kołodziejczyk.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-07-06 15:09 GMT+02:00 Philip Withnall <span dir="ltr"><<a href="mailto:philip@tecnocode.co.uk" target="_blank">philip@tecnocode.co.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
As Youness says, you have a couple of options:<br>
• Call nice_agent_recv() or nice_agent_recv_messages() in a loop in a<br>
separate thread.<br>
• Use the NiceInputStream retrieved by nice_agent_get_io_stream(), and<br>
call g_pollable_input_stream_create_source(), then attach the GSource<br>
that returns to your GMainContext, just as nice_agent_attach_recv()<br>
does.<br>
<br>
This is because the NiceAgent needs to have started receiving packets<br>
before it can discover the reflexive candidates, as Youness says.<br>
<span class="HOEnZb"><font color="#888888"><br>
Philip<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, 2014-07-04 at 04:21 -0400, Youness Alaoui wrote:<br>
> Hi,<br>
><br>
><br>
><br>
> I'm not sure how it works as I hadn't implemented that part, but I'm<br>
> guessing you need to call nice_agent_recv in order for it to receive<br>
> the stun messages and discover the server reflexive and peer reflexive<br>
> candidaets. I think you need to create a separate thread that will<br>
> continuously call the function or something like that. Maybe have a<br>
> look at how the GIO implementation works, it could give you ideas.<br>
><br>
><br>
> I hope this helps,<br>
> Youness.<br>
><br>
><br>
><br>
><br>
> On Mon, Jun 30, 2014 at 8:17 AM, Sudesh Kumar <<a href="mailto:sudeshbks@gmail.com">sudeshbks@gmail.com</a>><br>
> wrote:<br>
> I have tried using the nice_agent_recv function in my code,<br>
> but the problem is I have to use the peer reflexive candidate<br>
> as my selected component. As per the function definition<br>
><br>
><br>
> nice_agent_recv_messages must not be used in combination<br>
> with nice_agent_attach_recv() on the same stream/component<br>
> pair.<br>
><br>
><br>
><br>
> but I can get the peer reflexive candidates only if I attaches<br>
> the stream's component's sockets to the Glib Mainloop Context<br>
> using nice_agent_attach_recv() before gathering the local<br>
> candidates.<br>
><br>
><br>
> Please help me in advance on how to use the nice_agent_recv()<br>
> function.<br>
><br>
><br>
> Thanks & Regards,<br>
> Sudesh<br>
><br>
><br>
> On Mon, Jun 23, 2014 at 7:12 PM, Sudesh Kumar<br>
> <<a href="mailto:sudeshbks@gmail.com">sudeshbks@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
><br>
> I am new to libnice and I am able to execute the<br>
> examples provided in the package. I can see the<br>
> nice_agent_attach_recv function is used to read the<br>
> data from connected peer in all the examples and this<br>
> is a callback function.<br>
><br>
><br>
> I want to use the nice_agent_recv function instead of<br>
> nice_agent_attach_recv, but I am unsure about how to<br>
> use it.<br>
><br>
><br>
> Can u please provide me a sample code(possibly editing<br>
> in simple-example.c) on how to use nice_agent_recv<br>
> function.<br>
><br>
> Thanks & Regards,<br>
> Sudesh<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>
><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>
</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>