Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

How to set timeout for "gethostbyname(...)"

Is there any way to set timeout for the winsock method gethostbyname(...) in VC? If not, is there any fast way to figure out if the target computer (win95/98 and NT4) is connected to some network right now?

Regards
  Søren

0
svj
Asked:
svj
1 Solution
 
jkrCommented:
There is no way to set the timeout. But you could use 'NetServerGetInfo()' to test whether the target computer is connected, as the timeout isn't that long...
The problem with this function is just that NT and Win95 use different headers, DLLs and import libs, hence. So the best way is to call it dynamically after retrieveing a function pointer through 'GetProcAddress()'

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now