|
-
Feb 20th, 2003, 01:59 PM
#1
Thread Starter
Lively Member
Winsock - Pinging problem
All,
Urgent this one...
I have a Winsock which sends a string saying "PING" to my controller on the other end.
The controller will respond with a "PING" back, otherwise it will send other monitor data back.
Whats happening is that my VB program seems to be getting confused between the two.....how do i stop this? I have a statement in the dataarrival function saying...
If (data == "PING") then
do this
else
do this
COuld it be that my controller is sending data back too fast??? Or is there another clever way round the problem?
Matt
Whhy wont this damn thing work!! Damn it!!!
-
Feb 21st, 2003, 04:36 AM
#2
Thread Starter
Lively Member
Anyone help with this...its a real pain!
Matt
Whhy wont this damn thing work!! Damn it!!!
-
Feb 21st, 2003, 07:19 AM
#3
Member
Is it just an ICMP Ping you wish to send. If so you can use VB to send ping and return the result without using the winsock connection. Simply send an ICMP echo and wait for the result.
check this page out
http://www.mvps.org/vbnet/code/internet/ping.htm
it should give you everything you need
J
The problem with making something idiot proof is that sooner or later somebody just invents a better idiot!!!
-
Feb 21st, 2003, 07:57 AM
#4
Thread Starter
Lively Member
So will this code run in the background?
The reason i am pinging is to maintain communication - when the PINGing occures, the controller (running a C program) is already connected to my VB end and transfering data quite rapidly. The idea of the pinging it flag an error if the link goes down....for example, if the ethernet cable gets cut.
Im not sure if this code fits the bill?!? Or is there another way?
Matt
Whhy wont this damn thing work!! Damn it!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|