<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.4.4">
</HEAD>
<BODY>
Hi,<BR>
<BR>
Thanks for the answer, <BR>
<BR>
Clear for me.<BR>
<BR>
<BR>
Thanks,<BR>
Ant&#243;nio<BR>
<BR>
On Tue, 2014-05-27 at 12:33 +0300, Shlomi Agiv wrote:
<BLOCKQUOTE TYPE=CITE>
    at the beginning of&nbsp;recvEventTimed() there is the line:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    if (!ms) {
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    return esl_recv_event(handle, check_q, save_event);
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    }
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    so if you send ms=0, then it's exactly the same as esl_recv_event()
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    If you're already using esl, then you might as well look at the esl code, it's written in plain c and a lot of it is quite easy to understand at first glance
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    On Mon, May 26, 2014 at 10:40 AM, Grant Bagdasarian &lt;<A HREF="mailto:GB@cm.nl">GB@cm.nl</A>&gt; wrote:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        Hello,<BR>
        <BR>
        &nbsp;<BR>
        <BR>
        Their behavior is different, but both are used to receive events.<BR>
        <BR>
        &nbsp;<BR>
        <BR>
        recvEvent blocks until Freeswich sends it an Event. <BR>
        <BR>
        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. <BR>
        <BR>
        &nbsp;<BR>
        <BR>
        I use both variants for different scenarios. <BR>
        <BR>
        &nbsp;<BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <B>From:</B> <A HREF="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</A> [mailto:<A HREF="mailto:freeswitch-users-bounces@lists.freeswitch.org">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">freeswitch-users@lists.freeswitch.org</A><BR>
        <B>Subject:</B> [Freeswitch-users] ESL: recvEvent vs recvEventTimed<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        &nbsp;<BR>
        <BR>
        Hi all,<BR>
        <BR>
        I'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&nbsp; 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&#243;nio <BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        _________________________________________________________________________<BR>
        Professional FreeSWITCH Consulting Services:<BR>
        <A HREF="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR>
        <A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A><BR>
        <BR>
        FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
        <A HREF="http://www.cudatel.com">http://www.cudatel.com</A><BR>
        <BR>
        Official FreeSWITCH Sites<BR>
        <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
        <A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A><BR>
        <A HREF="http://www.cluecon.com">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">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
        UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
        <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<A HREF="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A>
<A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<A HREF="http://www.cudatel.com">http://www.cudatel.com</A>

Official FreeSWITCH Sites
<A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A>
<A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A>
<A HREF="http://www.cluecon.com">http://www.cluecon.com</A>

FreeSWITCH-users mailing list
<A HREF="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A>
<A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A>
UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A>
<A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>