NetTalk Central

Author Topic: How to test if server is alive/responding ?  (Read 4073 times)

wvanderstek

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
How to test if server is alive/responding ?
« on: March 06, 2009, 03:32:16 AM »
We do have several servers running at service providers. We want to write a small program to see if these servers are still alive. Could anybody give a clue how to do that ?

All the servers are only listening on port 443.

Thanks,
Wilco

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: How to test if server is alive/responding ?
« Reply #1 on: March 06, 2009, 03:43:24 AM »
Hallo,


I do a fetch,

FetchServer.Fetch('https://127.0.0.1:7070')

If you get error then the server is close else is open.

It works very good for me.


Regards,
Robert

wvanderstek

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: How to test if server is alive/responding ?
« Reply #2 on: March 06, 2009, 03:55:30 AM »
Hello Robert,

Thanks for the fast reply. Could you tell me where you FetchServer is located, caues I do get an unknown procedure label when compiling. I have looked in the dirs etc, but found nothing.

Thanks,
Wilco

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to test if server is alive/responding ?
« Reply #3 on: March 06, 2009, 07:41:31 AM »
Wilco,

Use the NetWebClient class.
ie in Robert's example FetchServer is the name of an object, of type NetWebClient that he's created. You can use the normal NetTalk extension to add a new object.

Also see one of the webclient examples.

Cheers
Bruce

wvanderstek

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: How to test if server is alive/responding ?
« Reply #4 on: March 09, 2009, 01:28:26 AM »
Great, thanks, I will take a look at it.

Best,
Wilco