PC Review


Reply
Thread Tools Rate Thread

How can i put a timeout on a sub

 
 
=?iso-8859-1?B?UultaQ==?=
Guest
Posts: n/a
 
      10th Dec 2003
Hi,

I'm trying to scan some computer with WMI. All my call
are a procedure call SCAN(). Something, the procedure get
stock in a request call to a network computer (the
computer is always online and i have permissions to
scan). I'll like to know how to put a timeout value to my
sub so i can stop the process and begin a scan to another
computer.

Thanks
 
Reply With Quote
 
 
 
 
Jerry Ham
Guest
Posts: n/a
 
      10th Dec 2003
If you are scanning machines on the network, you are really going to want to
use multiple threads anyway since most of your time is spent waiting for a
response from the remote machine. You should create a class to contain the
data you are looking for and have a procedure in that class be the thread
entry point. Then start multiple threads to do the actual work. If you
really need a timeout (you may not when architected this way, unless ALL
threads get stuck the same way on different machines), then you can always
abort any thread that gets stuck for too long.

Jerry

"Rémi" <(E-Mail Removed)> wrote in message
news:0c0f01c3bf39$200167f0$(E-Mail Removed)...
> Hi,
>
> I'm trying to scan some computer with WMI. All my call
> are a procedure call SCAN(). Something, the procedure get
> stock in a request call to a network computer (the
> computer is always online and i have permissions to
> scan). I'll like to know how to put a timeout value to my
> sub so i can stop the process and begin a scan to another
> computer.
>
> Thanks



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      10th Dec 2003
* "Rémi" <(E-Mail Removed)> scripsit:
> I'm trying to scan some computer with WMI. All my call
> are a procedure call SCAN(). Something, the procedure get
> stock in a request call to a network computer (the
> computer is always online and i have permissions to
> scan). I'll like to know how to put a timeout value to my
> sub so i can stop the process and begin a scan to another
> computer.


Maybe starting the work in a separate thread and aborting this thread is
a solution. Have a look for "multithreading" in the documentation for
info on how to do that.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Timeout expired. The timeout period elapsed prior to comple michael Microsoft ADO .NET 3 22nd Feb 2009 06:05 PM
IIS Timeout , Web Config Timeout, Page Timeout. =?Utf-8?B?TWlrZSBNb29yZQ==?= Microsoft Dot NET 0 17th Jan 2006 06:52 PM
Timeout expired. The timeout period elapsed prior to completion of the operatio Manoj K Microsoft ADO .NET 5 10th Jan 2004 03:26 AM
Timeout expired. The timeout period elapsed prior to completion of the operation Manoj K Microsoft C# .NET 4 4th Jan 2004 12:50 PM
Timeout expired. The timeout period elapsed prior to completion of the operation Manoj K Microsoft VB .NET 1 4th Jan 2004 08:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:11 PM.