[Freeswitch-users] ESL: recvEvent vs recvEventTimed
Shlomi Agiv
shlomi.agiv at cell-buddy.com
Tue May 27 13:33:12 MSD 2014
at the beginning of recvEventTimed() there is the line:
if (!ms) {
return esl_recv_event(handle, check_q, save_event);
}
so if you send ms=0, then it's exactly the same as esl_recv_event()
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
On Mon, May 26, 2014 at 10:40 AM, Grant Bagdasarian <GB at cm.nl> wrote:
> Hello,
>
>
>
> Their behavior is different, but both are used to receive events.
>
>
>
> recvEvent blocks until Freeswich sends it an Event.
>
> 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.
>
>
>
> I use both variants for different scenarios.
>
>
>
> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Antonio
> *Sent:* Saturday, May 24, 2014 1:52 PM
> *To:* freeswitch-users at lists.freeswitch.org
> *Subject:* [Freeswitch-users] ESL: recvEvent vs recvEventTimed
>
>
>
> Hi all,
>
> I'm doing a esl program to get all the events from fs and I always want to
> wait for an event before continue.
>
> but i facing a difficult decision to choose between recvEvent() or
> recvEventTimed(0).
>
> I read in the wiki:
> recvEvent() - blocks until it receives an event
> recvEventTimed(0) - waits X ms or blocks until it receives an event
>
> so they are the same or no?
> For your experience with ESL what method do you recommend?
>
> Thanks,
> António
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140527/4234969d/attachment.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list