BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to ping many hosts?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Tyler McCloud
Guest





PostPosted: Mon Jan 17, 2005 8:32 pm    Post subject: How to ping many hosts? Reply with quote



I'm sorry I posted in the wrong thread. I'm posting in the right place now.
Sorry about the double post.

Can anyone help me as to how I could use TidICMPclient component to ping
many hosts and get their responses without having to use more then 1
component. I want to write a program to keep track of computers/hardware
that are pingable.



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Jan 17, 2005 9:50 pm    Post subject: Re: How to ping many hosts? Reply with quote




"Tyler McCloud" <tyler (AT) designlogic (DOT) net> wrote


Quote:
Can anyone help me as to how I could use TidICMPclient component to
ping many hosts and get their responses without having to use more then 1
component. I want to write a program to keep track of computers/hardware
that are pingable.

Have a look at the "multithreaded stThreadBlocking Tserversocket /
Tclientsocket" discussion in this same newsgroup. You can use the same
concept with TIdICMPClient.


Gambit



Back to top
Martin James
Guest





PostPosted: Tue Jan 18, 2005 5:23 am    Post subject: Re: How to ping many hosts? Reply with quote



Quote:

Can anyone help me as to how I could use TidICMPclient component to ping
many hosts and get their responses without having to use more then 1
component. I want to write a program to keep track of computers/hardware
that are pingable.


Why the 'one component' restriction? This forces you to serialise the
pings. It's usual to perform the pings in parallel, for which you need more
than one component.

If you insist on one component, the pings may take some considerable time.

Rgds,
Martin



Back to top
Tyler McCloud
Guest





PostPosted: Tue Jan 18, 2005 10:31 pm    Post subject: Re: How to ping many hosts? Reply with quote

Well I would like to do something like so


for count:=0 to list.of.ips do begin
if ping(hosthere) then begin
//pinable within 500ms
end else begin
//over 500ms or no response.
end;
end;
"Martin James" <mjames_falcon (AT) dial (DOT) pipex.com> wrote

Quote:

Can anyone help me as to how I could use TidICMPclient component to ping
many hosts and get their responses without having to use more then 1
component. I want to write a program to keep track of
computers/hardware
that are pingable.


Why the 'one component' restriction? This forces you to serialise the
pings. It's usual to perform the pings in parallel, for which you need
more
than one component.

If you insist on one component, the pings may take some considerable time.

Rgds,
Martin





Back to top
Martin James
Guest





PostPosted: Wed Jan 19, 2005 12:57 am    Post subject: Re: How to ping many hosts? Reply with quote

Quote:
for count:=0 to list.of.ips do begin
if ping(hosthere) then begin
//pinable within 500ms
end else begin
//over 500ms or no response.
end;
end;

Well, yes, something of that sort would surely work, though 500ms is short
for many routes. I assumed you wanted something better than a loop that, if
executed in the main thread, would sieze up the app for
(500*listOfIps.count) ms. If you are going to thread the ping to avoid the
frezing, it would make more sense, in general, to use more than one
component so as to allow the pings to run concurrently, either by using one
thread per server, (short list), or a fixed-size pool of threads, (long
list).

Rgds,
Martin



Back to top
Tyler McCloud
Guest





PostPosted: Mon Jan 24, 2005 9:21 pm    Post subject: Re: How to ping many hosts? Reply with quote

Yes I see what you're saying. My skill for writing code isn't that good so
I wanted to keep it easy and simple. I guess I'll just have learn some
more. I appreciate the ideas and help.

"Martin James" <mjames_falcon (AT) dial (DOT) pipex.com> wrote

Quote:
for count:=0 to list.of.ips do begin
if ping(hosthere) then begin
//pinable within 500ms
end else begin
//over 500ms or no response.
end;
end;

Well, yes, something of that sort would surely work, though 500ms is short
for many routes. I assumed you wanted something better than a loop that,
if
executed in the main thread, would sieze up the app for
(500*listOfIps.count) ms. If you are going to thread the ping to avoid
the
frezing, it would make more sense, in general, to use more than one
component so as to allow the pings to run concurrently, either by using
one
thread per server, (short list), or a fixed-size pool of threads, (long
list).

Rgds,
Martin





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.