boy...
09-06-2001, 09:33 AM
I have just completed a Pinging project, but i found that when the application is pinging, my computer will be really sluggish...
If i try to ping 100 times in one click, it won't let me stop it even i click X button for 100 times!! !!!!
I know this is not a error, anyone knows how to aviod this problem? pinging without any delay??
a novice
ChiefRedBull
09-06-2001, 10:21 AM
Try pinging only a few times...... ie 5-10. 100 is far too many anyway.
I have found that VB doesn't like large or two many nested loops - mine often crashes if I try to loop over about 50 times... maybe its a memory problem?
Chief
"Dammit Smithers, this is brain surgery not rocket science!! Now hand me that ice cream scoop..."
Thinker
09-06-2001, 10:32 AM
Try not sending out the next ping until you receive the response from
the first ping. Also, you should have a pause and only do a limited
number. Otherwise, you are flood pinging - a bad thing.
I think therefore I am... sometimes right. images/icons/wink.gif
BillSoo
09-06-2001, 11:23 AM
If you put a doevents within your loop, you *might* be able to cancel the loop, depending on how you've coded it.
For instance:
dim bDone as boolean 'module level or global variable
....
'code in some sub routine...
bDone = false
for i = 1 to 50
ping
doevents
if bDone then exit for
next i
....
sub cmdCancelButton_Click()
bDone = true
end sub
In the for-next loop, you check the value of the bDone flag to see if the user pressed the cancel button. The DoEvents is there to give the program a chance to respond to the click event.
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
boy...
09-07-2001, 06:40 AM
Ping --- sends 32byte data from a computer to another.
i think, It should be same as Scanning a IP. Why people can
make programs which can scan over 200 ports in one minute
without any delay?
What are the differeneces between ping and scan? anyone can tell me ? I am very interested in winsock.ocx, i would like to know more about it! Thank you all!
a novice <P ID="edit"><FONT class="small"><EM>Edited by boy... on 09/07/01 07:41 AM.</EM></FONT></P>
Garrett Sever
09-07-2001, 06:49 AM
If you want Winsock help, go to the Communications Help (http://www.visualbasicforum.com/bbs/postlist.php?Cat=&Board=Comm) board. Actually, a mod/admin should probably move "ping" questions there too.
Regards,
-<font color=purple>The Hand</font color=purple>
<font color=green>All your code are belong to us...</font color=green> images/icons/tongue.gif