473,765 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i put a timeout on a sub

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
Nov 20 '05 #1
2 1117
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" <an*******@disc ussions.microso ft.com> wrote in message
news:0c******** *************** *****@phx.gbl.. .
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

Nov 20 '05 #2
* "Rémi" <an*******@disc ussions.microso ft.com> 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>
Nov 20 '05 #3

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

Similar topics

9
2625
by: E Sullivan | last post by:
I am having a time out issue when multiple users are accessing the server. This time out does not happen all of the time. My understanding is that the time out value is actually set in two places. I believe one is in the asp pages for the session itself, and the other is more of a system timeout settting in IIS. Would one of these supercede the other if the two are different? I have already looked at the time out setting in IIS, and it...
12
43195
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
2
862
by: Greg Decos | last post by:
I am using forms authentication using a FormsAuthenticationTickets set to expire in 30 minutes and the ticket is added to the collection of cookies. I am not sure where the following values are used: 1. timeout in: <authentication mode="Forms"> <forms ...timeout="30" 2. session timeout defined in IIS 3. timeout in
4
15468
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site | Properties | Configuration | Options | Enable Session State Session timeout 20 (3) within Global.asax.vb file - Session_Start subroutine can use Session.Timeout=x minutes or (4) within any web page, i.e., <web page>.aspx can use...
17
5215
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be running continuously and refreshing once an hour. I there set timeout= 61 in <sessionState section and on my page it says <meta http-equiv="refresh" content="3600">. I also set timeout=120 in the <forms section of web.config to make sure
4
9457
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change the forms authentication to be a large value for that page also. TIA - Jeff.
22
5294
by: Nick Craig-Wood | last post by:
Did anyone write a contextmanager implementing a timeout for python2.5? I'd love to be able to write something like with timeout(5.0) as exceeded: some_long_running_stuff() if exceeded: print "Oops - took too long!"
25
6098
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
5
3782
by: Masso | last post by:
Hallo to the group, my question is this: where i have to set timeout in a web application? If i set into sessionState with property Timeout="60", after 20 minutes the session is over. Always after 20 minutes, i cannot set a timeout greater than 20 minutes. Our configuration is the following: - Server with Win2003, i.e. IIS 6.0 - Web application developed with vb.net simply composed by:
2
6445
by: JimLad | last post by:
Hi, I've got a very basic asp.net page that accesses a very slow db query and siplays to screen. I'm hitting a timeout aftre about 3.5 to 4.5 minutes - seems to be variable. SQL connection string timeout is set to 3000s. SQL Command timeout is set to 3000s. IIS Connection Timeout is set to 120s. ASP.NET script timeout is not set so must use default of 90s.
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.