<div dir="ltr">at the beginning of <span style="font-family:&#39;Times New Roman&#39;,serif;font-size:16px">recvEventTimed() there is the line:</span><div><span style="font-family:&#39;Times New Roman&#39;,serif;font-size:16px"><div>
if (!ms) {</div><div><span class="" style="white-space:pre">        </span>return esl_recv_event(handle, check_q, save_event);</div><div>}</div><div><br></div><div>so if you send ms=0, then it&#39;s exactly the same as esl_recv_event()</div>
<div><br></div><div>If you&#39;re already using esl, then you might as well look at the esl code, it&#39;s written in plain c and a lot of it is quite easy to understand at first glance</div></span></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, May 26, 2014 at 10:40 AM, Grant Bagdasarian <span dir="ltr">&lt;<a href="mailto:GB@cm.nl" target="_blank">GB@cm.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hello,<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Their behavior is different, but both are used to receive events.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">recvEvent blocks until Freeswich sends it an Event. <u></u><u></u></span></p>
<p class="MsoNormal">recvEventTimed(1000) waits for 1 second max to receive an event from FS. If no event is received within 1 second, the program will continue to execute the next line of code. <u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">I use both variants for different scenarios. <span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal">
<b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Antonio<br>
<b>Sent:</b> Saturday, May 24, 2014 1:52 PM<br><b>To:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br><b>Subject:</b> [Freeswitch-users] ESL: recvEvent vs recvEventTimed<u></u><u></u></span></p>
</div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hi all,<br><br>I&#39;m doing a esl program to get all the events from fs and I always want to wait for an event before continue.<br>
<br>but i facing a difficult decision to choose between recvEvent() or recvEventTimed(0).<br><br>I read in the wiki:<br>recvEvent() - blocks until it receives an event<br>recvEventTimed(0) - waits X ms  or blocks until it receives an event<br>
<br>so they are the same or no?<br>For your experience with ESL what method do you recommend?<br><br>Thanks,<br>António <u></u><u></u></p></div></div></div></div><br>_________________________________________________________________________<br>

Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>