473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Async Delegate question

Can I use Async delegates to do infinite polling in vb.net?

Nov 21 '05 #1
2 1162
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?

Nov 21 '05 #2
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

"Adam Goossens" <ad***********@gmail.com> wrote in message
news:OK*************@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?

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dave | last post by:
I'm using the BeginInvoke method of a delegate to invoke a thread asynchronously and then use the EndInvoke to retrieve the value. This works wonderfully until a Serviced Component is added to...
6
by: Amy L. | last post by:
I am working on a project where I will have a ton of async DNS calls in a console application. I would like to process the results of the Aync calls on the same thread that made the async call. ...
10
by: Shawn Meyer | last post by:
Hello - I am trying to write a class that has an async BeginX and EndX, plus the regular X syncronous method. Delegates seemed like the way to go, however, I still am having problems getting...
11
by: ryan | last post by:
Hi, I've omitted a large chunk of the code for clarity but the loop below is how I'm calling a delegate function asynchronously. After I start the each call I'm incrementing a counter and then...
4
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? ...
7
by: Shak | last post by:
Hi all, I'm trying to write a thread-safe async method to send a message of the form (type)(contents). My model is as follows: private void SendMessage(int type, string message) { //lets...
9
by: BartMan | last post by:
Greetings, I am trying to fire aysnc events in c++/clr, and I can't seem to get it to work. It seems to work fine in c#, but when I try c++/clr, I can't seem to get it to compile in the c++/clr...
12
by: =?Utf-8?B?cGI=?= | last post by:
I am having trouble doing a redirect in an async asp.net implemention. Most of the time it works, but when it doesn't it just "hangs", the browser never gets any return page. If I run it under the...
2
by: jojoba | last post by:
Hello to all! I have a fairly simple webservice running in asp.net ajax under c# (vs 2008). I built the service and it runs just dandy when i test it by itself in visual studio. However, to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.