Jean,

Thanks for the code.  I spent some time pulling it apart in order to 
understand it, and to add the ability to control packet size.  Since that 
process is complete I have concluded that this code only verifies that 
the remote address can be contacted but does not send a packet whose size 
can be varied.  I have certainly learned from the process but would like 
to find something which accepts a packet length parameter and returns the 
round trip time in milliseconds.

Other suggestions?

TIA - Joe
 
On Friday, September 21, 2007  8:27 AM, Jean Laeremans wrote:
>
>Date: Fri, 21 Sep 2007 14:27:18 +0200
>From: Jean Laeremans
>To: [EMAIL PROTECTED]
>Subject: Re: Pinging from VFP suggestions?
>
>On 9/21/07, Joe Yoder <[EMAIL PROTECTED]> wrote:
>> I want to plot ping times to a remote site under VFP.  Is there an ActiveX 
>> control with the ping function available?
>>
>> Another suggestion?
>>
>> TIA - Joe Yoder
>
>* by [EMAIL PROTECTED]
>* with LOTS of help from (actually; all the hard work by) Markus Voellmy
>*
>* ?ping("jassing.com",80) would check jassing.com to be sure it's
>running a web server
>* NOTE: it does not do any dns lookups; so if you're checking for a
>mail server, you need
>*      to resolve the mx record yourself.
>#DEFINE sckClosed                              0
>#DEFINE sckOpen                                        1
>#DEFINE sckListening                   2
>#DEFINE sckConnectionPending   3
>#DEFINE sckResolvingHost               4
>#DEFINE sckHostResolved                5
>#DEFINE sckConnecting                  6
>#DEFINE sckConnected                   7
>#DEFINE sckClosing                             8
>#DEFINE sckError                               9
>
>FUNC PingState
>  LPARAM tnState
>  LOCAL lcState
>  DO CASE
>  CASE tnState = sckClosed
>    lcState = "Closed"
>  CASE tnState = sckOpen
>    lcState = "Open"
>  CASE tnState = sckListening
>    lcState = "Listening"
>  CASE tnState = sckConnectionPending
>    lcState = "Waiting"
>  CASE tnState = sckResolvingHost
>    lcState = "Resolving"
>  CASE tnState = sckConnecting
>    lcState = "Connecting"
>  CASE tnState = sckConnected
>    lcState = "Connected"
>  CASE tnState = sckClosing
>    lcState = "Closing"
>  CASE tnState = sckError
>    lcState = "Error"
>  OTHERWISE
>    lcState = "Unknown"
>  ENDCASE
>  RETURN lcState
>
>FUNC ping
>  LPARAM tcServer, tnPort
>  LOCAL lnState, loPing, lnLast
>  DECLARE INTEGER OutputDebugString ;
>    IN kernel32 ;
>    AS dbgout;
>    STRING cString
>  loPing=CREA("mswinsock.winsock")
>  WITH loPing
>    .remoteport=tnPort
>    .remotehost = tcServer
>    .CONNECT()
>    lnLast = -1
>    DO WHILE .state < sckConnected
>      IF lnLast # .state
>        dbgout( "Ping State: "+PingState( .state ))
>        lnLast = .state
>      ENDIF
>    ENDDO
>    dbgout( "Ping State: "+PingState( .state ))
>    lnState = .state
>    .CLOSE()
>    dbgout("Ping State: "+PingState(.state))
>  ENDWITH
>  RETURN lnState#9
>ENDFUNC
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to