473,394 Members | 1,785 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,394 software developers and data experts.

how to kill a connection attempt

hi,
i am trying to connect to a remote machine to find out if anyone's logged in
to it using wmi's ManagementObjectSearcher object. I am successful in
establishing the connection and getting the information i need from machines
that are up and running. However, when i try to access a machine that is off
or not accessible, the get command runs for almost 30 seconds and then tells
me that the RPC server is not available. This is expcted and understandable.
What i would like to figure out is how to automatically kill the connection
attempt after a determined amount of time. For example, i would like to try
to connect, but if it has been more than 5 seconds, then the conection should
fail and the program should move on.

Can someone provide me wotu some information as to how to do this?

Thank you!
Nov 21 '05 #1
1 1025
Hello Andres
What object are using to connect to remote machine. Depending on the
object,You can set the appropriate timeout.
These are just my thoughts.
Deepak
"andres" wrote:
hi,
i am trying to connect to a remote machine to find out if anyone's logged in
to it using wmi's ManagementObjectSearcher object. I am successful in
establishing the connection and getting the information i need from machines
that are up and running. However, when i try to access a machine that is off
or not accessible, the get command runs for almost 30 seconds and then tells
me that the RPC server is not available. This is expcted and understandable.
What i would like to figure out is how to automatically kill the connection
attempt after a determined amount of time. For example, i would like to try
to connect, but if it has been more than 5 seconds, then the conection should
fail and the program should move on.

Can someone provide me wotu some information as to how to do this?

Thank you!

Nov 21 '05 #2

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

Similar topics

10
by: Vilmar Brazão de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '»»Before comes routines to access data base and to send email. Set objWshell =...
10
by: Jako Menkveld | last post by:
I'm building a relatively simple client-server app. One of the functions of the client is to notify the server when it terminates, this all works fine. The problem comes in when the server is...
0
by: David | last post by:
I need to kill an IP connection from a c# program but this is not a connection that the program started. Eg. kill a connection when the program aborts and restarts and the connection still...
2
by: Fabrice | last post by:
Hello, I 'would like to build a system (based on database, not SqlServer but MySQL) to permit only one session per user. I'm using a form athentication. My Solution : --------------- When...
14
by: Dixie | last post by:
I am trying to write some code that when I exit my application kills all of the text files in a certain folder. It is possible that some of those files are locked because someone else is using...
2
by: Dennis | last post by:
I'm getting the following problem occasionally...the application will work perfectly well for a period of time and then this pops up. I have tried turning off the default proxy in the...
1
by: DaveP | last post by:
Hello, I do maintenance on the Back end and have like 10 - 20 connections open...specialized scrips i run and they dont need to be stored proc's is there a way to kill the connection when the...
2
by: deciacco | last post by:
I have a NotifyIcon application. (c# 2) I want to be able to catch a kill/shutdown attempt so that I can call Dispose() to remove the icon. I tried to create an event handler for ApplicationExit...
18
by: =?Utf-8?B?VGhlU2lsdmVySGFtbWVy?= | last post by:
Because C# has no native SSH class, I am using SharpSSH. Sometimes, for reasons I do not know, a Connect call will totally lock up the thread and never return. I am sure it has something to do...
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: 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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.