andresleon
Member
- Joined
- Jun 22, 2005
- Messages
- 9
- Programming Experience
- 1-3
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 with some information as to how to do this?
Thank you!
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 with some information as to how to do this?
Thank you!