Home All Groups Group Topic Archive Search About

Async Delegate question

Author
13 Apr 2005 5:40 PM
Viet
Can I use Async delegates to do infinite polling in vb.net?

Author
14 Apr 2005 1:23 AM
Adam Goossens
I don't exactly understand what you mean. By "infinite polling", do you
mean sitting in a loop and polling indefinitely (maybe sleeping once in
a while), or polling once every X seconds for ever?

If it's the former, then yes, you can. Fire the polling method using an
async delegate to run it on a second thread.

If it's the latter, no, you can't directly - you'll need to use a
System.Threading.Timer to trigger the poll once every X seconds.

Regards,
-Adam.

Viet wrote:
Show quoteHide quote
> Can I use Async delegates to do infinite polling in vb.net?
>
>
>
Author
14 Apr 2005 3:30 PM
Viet
Actually, its the former: fire the polling method by sitting in a loop and
polling indefinitely. The code is I used is:
if objectIASyncResult.iscompleted  = true then
'do something

but everytime I execute it, it executes once. Is there any code examples for
this?
THanks,
Viet



Show quoteHide quote
"Adam Goossens" <adam.gooss***@gmail.com> wrote in message
news:OKZiKCJQFHA.576@TK2MSFTNGP15.phx.gbl...
> I don't exactly understand what you mean. By "infinite polling", do you
> mean sitting in a loop and polling indefinitely (maybe sleeping once in
> a while), or polling once every X seconds for ever?
>
> If it's the former, then yes, you can. Fire the polling method using an
> async delegate to run it on a second thread.
>
> If it's the latter, no, you can't directly - you'll need to use a
> System.Threading.Timer to trigger the poll once every X seconds.
>
> Regards,
> -Adam.
>
> Viet wrote:
> > Can I use Async delegates to do infinite polling in vb.net?
> >
> >
> >