shell vs. process
luis at anachreon.co.uk
Sun Oct 8 12:34:24 CDT 2006
Ping runs over ICMP, the ICMPD to be precise (Port 5813) and insofar
as I can see we can open
sockets in Revolution. It should be a case of creating a data packet and
sending it through (the Echo Request) to the IP address you're Pinging
to and listening for the 'Echo Reply' (which should be identical to the
initial Echo Request). The Echo Request follows a specific format (four
32bit packets?) so you'd need to recreate that. I haven't looked through
the binary tools in Revolution, so I'm not too sure how this would be
If you're Pinging an 'address' (by which I mean the human readable form
of the IP address) then you'd need to get that translated into the IP
address for the packet send.
Another way round: If you want to 'Ping' a specific IP address (which
doesn't change AND you have access to the server) you could create a
small Revolution app for the other end (the server end) that will
respond to your 'Ping' request form your 'client' app (essentially,
you're recreating a two-way only Ping system with the Revolution sockets
at your disposal) so you needn't rely on shell/system calls.
Or: Use 'get URL' (or 'put URL') in Rev with a web address that exits -
If there's no data then either the site is down or the line is not up.
I know it's not exactly 'shell vs process' related, but I thought it
might help with avoiding a shell call just to check the line (via Ping).
Sarah Reichelt wrote:
>> In Revolution, which function is better for calling a long-running
>> external process and reading data from the process in a non-blocking
>> format, for instance, streaming the output from tcpdump into a text
>> Looking at the docs, it appears that "process" is what I want, but
>> I saw
>> something that says that "open process" on OS X is only useful for
>> launching applications...not launching background command-line
>> and reading their output to stdout as one would expect to do on a
>> Unix-style platform. Since I am targeting OS X, I need to know how
>> others handle this.
> Getting to this thread a bit late, but here is how I do a ping without
> blocking anything else. It is very quick if the ping is successful,
> but it's the failure delay that has to be allowed for.
More information about the use-livecode