Hi Kirk,

Cool.  Thanks.

This gave me some good ideas!

Randy Engle
XC2 Software LLC – XC2LIVE!

-----Original Message-----
From: 4D_Tech [mailto:[email protected]] On Behalf Of Kirk Brooks 
via 4D_Tech
Sent: Monday, August 14, 2017 8:24 AM
To: 4D iNug Technical <[email protected]>
Cc: Kirk Brooks <[email protected]>
Subject: Re: Get Info from a 4D Client - aka Interclient communication

Randy,
You could have a background process on 4D server that periodically pings the 
web server. Or makes an http call to it. I use a service to monitor server 
status that relies on this approach. This will also raise a flag if the server 
is un-available for some reason even if it is running.

​But if 4D server is walled off from the internet I'd use Execute on client and 
Web is server running 
<http://doc.4d.com/4Dv15/4D/15.4/WEB-Is-server-running.301-3275028.en.html>.
But that requires you to know which client is running it. Maybe there are more 
than one? Using a table, like you're doing already, isn't such a terrible idea. 
But you could also do the same thing with variables and avoid the SET VARIABLE 
issues by using execute on server.

Let's say this loop is running in a background process on a client:

$webInfo:=JSON Parse("{}")
OB SET($webInfo;"machine";Current machine)

While(not($done))

OB SET($webInfo;"timestamp";Timestamp)
OB SET($webInfo;"running";WEB Is server running)

 If(WEB Is server running)// optional info

    ... // IP, # processes, ...

 End if


WEB_update_monitor($webInfo)

DELAY PROCESS(Current process;300)

End while


WEB_update_monitor executes on server :

// WEB_update_monitor
<>webInfo_obj:=$1


And on the server you have some monitor process running that looks at 
<>webInfo_obj and acts accordingly.

If more than one client might be involved I'd use an object array but the 
mechanics are the same.


On Sun, Aug 13, 2017 at 6:18 PM, Randy Engle via 4D_Tech < 
[email protected]> wrote:

> In this particular case, I've got the web server running on the 
> client, and I want to know if the web server is in fact running.
>
> --
Kirk Brooks
San Francisco, CA
=======================

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to