Tech Support > Microsoft Windows > Development Resources > How to poll server status over the Internet ?...
How to poll server status over the Internet ?...
Posted by Windows Application on June 26th, 2007


Hello,

I need to know if a server is Up and running before a client machine
interact with it. Can you please tell me if there is a function that
will
poll the server's status over the Internet ?

I need to use the following APIs in my program:

InternetOpen()
InternetConnect()
HttpOpenRequest()
HttpSendRequestEx()
HttpQueryInfo()
InternetQueryDataAvailable()
InternetReadFileEx()
InternetWriteFile()
HttpEndRequest()
InternetCloseHandle()

Thank you......

Posted by Kellie Fitton on June 26th, 2007


On Jun 26, 9:34 am, Windows Application <sammy_lb_2...@netzero.com>
wrote:

Hi,

You can use the following API to poll the server status:

IsDestinationReachable()

http://msdn2.microsoft.com/en-US/library/aa376851.aspx

Kellie.



Posted by Grzegorz Wróbel on June 26th, 2007


Windows Application wrote:
If InternetConnect() succeeded then you successfully connected to the
server.


--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D

Posted by Windows Application on June 26th, 2007


On Jun 26, 10:36 am, Grzegorz Wróbel </dev/n...@localhost.localdomain>
wrote:


After making the connection with the server, they will be more
than one connection to a site, so how can I choose from 100
established conections the needed one ? I need to know that
my connection is valid after some time have elapsed ?

Sammy.



Posted by Grzegorz Wróbel on June 26th, 2007


Windows Application wrote:
I don't know what is exactly your scenario with communicating with a server.

The next function you usually call after InternetConnect() is
HttpOpenRequest() and if it succeeds it means you successfully requested
a certain document (ie established connection to a particular url/file).

If you suspect the connection might be broken during reading or writing
to remote file you need to check each time if the function
InternetReadFile() or InternetWriteFile() succeeded (returned TRUE), if
not you can call InternetGetLastResponseInfo() to get the server error
description and/or try to reopen the connection and resend the request.

--
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D


Similar Posts