|
|
eWON wiki > eWON Support > Knowledge Base > Questions and Answers > How to do a PING function with Basic
How to do a PING function with BasicFrom $1Table of contentsPurposeOften, eWON must drop something on a Server, but first thing to do is to know if this Server is available. On network world, we use the PING function to test the IP address of the targeted Server. eWON has no Ping function, but you can do a similar function with the Basic OPEN ImplementationPut the following code in your eWON Ping:
PRINT "ping ";Time$
CLOSE 1
ONSTATUS "goto ProcessStatus"
OPEN "tcp:10.0.120.122:80,10" FOR BINARY OUTPUT AS 1
a% = GETSYS PRG,"ACTIONID"
END
ProcessStatus:
PRINT "process ";Time$
b% = GETSYS PRG,"EVTINFO"
IF b%=a% THEN
SETSYS PRG,"ACTIONID",a%
c% = GETSYS PRG,"ACTIONSTAT"
IF c%=0 THEN
PRINT "PING 10.0.120.122:80 success"
ELSE
PRINT "PING 10.0.120.122:80 failed"
ENDIF
CLOSE 1
ENDIF
END
This Ping procedure will test the IP address 10.0.120.122 on port 80 with a TimeOut of 10 seconds (see Programming Guide: OPEN function for complete reference). KB-0002 How to do a PING with Basic
|