Solved

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

Posted on 1998-12-23
1
466 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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