Solved

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

Posted on 1998-12-23
1
459 Views
Last Modified: 2013-12-03
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
Comment
Question by:svj
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now