views:

42

answers:

1

My application does a CreateIC (and later, an OpenPrinter) for the user's default printer. When this is a remote printer, and that printer is powered down or otherwise not present on the network, it takes over 20 seconds for the CreateIC to return.

I'm looking for some call I can make that will give me a quick answer if the server is down (so I can return a status and not try to do the CreateIC/OpenPrinter).

My environment is c/c++ (non-managed).

A: 

I would recommend using the cURL library. They are available for all langues, allow you to hit addresses, and support timeouts. You could ping something on that IP address and make sure it responds in a quarter of a second, for instance.

Good luck!

TheJacobTaylor