Solved

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

Posted on 1998-12-23
1
460 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
ID: 1417622
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

23 Experts available now in Live!

Get 1:1 Help Now