Results 1 to 4 of 4

Thread: Winsock - Pinging problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Location
    NW England
    Posts
    110

    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!!!

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Location
    NW England
    Posts
    110
    Anyone help with this...its a real pain!

    Matt
    Whhy wont this damn thing work!! Damn it!!!

  3. #3
    Member
    Join Date
    Oct 2002
    Location
    UK
    Posts
    54
    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!!!

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Location
    NW England
    Posts
    110
    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
  •  



Click Here to Expand Forum to Full Width