[Live-devel] Reception Packet Information
Ross Finlayson
finlayson at live.com
Tue Jun 22 18:59:21 PDT 2004
>The trick is that within getCurrentReceiverPacketInfo(), I should do this:
>{
>// perform information gathering
>...
>// at the end, schedule another task
>env->taskScheduler().scheduleDelayedTask(n, getCurrentReceiverPacketInfo,
>data); // this will be executed next
>}
That's right.
>So it will be recursively executed by doEventLoop every n microseconds AND
>does not affect the live.com's thread. The idea is kind of like
>doGetNextFrame() in each source reading class, doGetNextFrame() perform the
>reading, then at the very end, there is a scheduleDelayedTask() call to loop
>back.
That's basically correct, except for your use of the word
"recursively". There's no recursion going on here. Note that that when
your "getCurrentReceiverPacketInfo()" function calls "scheduleDelayTask()"
to schedule another, future, call to "getCurrentReceiverPacketInfo()", it
doesn't actually call "getCurrentReceiverPacketInfo()" at that time. That
call doesn't happen until the thread of control returns to the event loop
("doEventLoop()"). So, there's no recursive call.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list