[Freeswitch-users] ESL: recvEvent vs recvEventTimed

Grant Bagdasarian GB at cm.nl
Mon May 26 11:40:11 MSD 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140526/c85ece14/attachment-0001.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list