a *fast* check for whether another machine is on the local network?

Daryl Williams daryl at synergetic-data.com
Thu Jun 13 19:53:42 EDT 2013


If I am understanding correctly you might try using either the netstat 
or route commands to find your default gateway, and if there is none 
then save things to the local database.

The problem with this approach will be determining the right syntax to 
use for the current platform your code is running on. Unfortunately the 
syntax is a bit different from windows to os x to linux, but they will 
all report on the routing tables, including the default router, at which 
point you just need to parse the command output (again different from 
platform to platform) an take the appropriate action. The output can be 
rather detailed and verbose, but should not too hard to parse.

Regards,

Daryl


On 6/13/13 4:19 PM, Dr. Hawkins wrote:
> On Thu, Jun 13, 2013 at 3:11 PM, Daryl Williams
> <daryl at synergetic-data.com> wrote:
>> It sounds like what you are really looking for is a local gateway to get to
>> the Internet, and to where ever the time entries are made?
>
> No; actually the opposite.
>
> If I have a connection, presumably by vpn (this is for postgres), I
> want to use it.  If there is no connection to the server, I want to
> put things into a local sqlite database, and use that to update the
> postgres base later.  I'm looking for a quick way to achieve this,
> rather than something with a lengthy timeout
>





More information about the Use-livecode mailing list