RE: Get Info from a 4D Client - aka Interclient communication

2017-08-14 Thread Randy Engle via 4D_Tech
Hi Kirk,

Cool.  Thanks.

This gave me some good ideas!

Randy Engle
XC2 Software LLC – XC2LIVE!

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk Brooks 
via 4D_Tech
Sent: Monday, August 14, 2017 8:24 AM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Kirk Brooks <lists.k...@gmail.com>
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 < 
4d_tech@lists.4d.com> 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:4d_tech-unsubscr...@lists.4d.com
**

**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Get Info from a 4D Client - aka Interclient communication

2017-08-14 Thread Kirk Brooks via 4D_Tech
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
.
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 <
4d_tech@lists.4d.com> 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:4d_tech-unsubscr...@lists.4d.com
**

RE: Get Info from a 4D Client - aka Interclient communication

2017-08-13 Thread Randy Engle via 4D_Tech
John,

Thanks for the tip.  Will consider!

Randy Engle, Director
XC2 Software LLC – XC2LIVE!

Maybe just SET PROCESS VARIABLE(-1;<>webServerInfoObject) to put the 
information on the server. Then a process on the server can monitor it or you 
can use a different client to read it using GET PROCESS VARIABLE.

John DeSoi, Ph.D.



> On Aug 13, 2017, at 8:18 PM, Randy Engle via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I need to get some info from a specific 4D Client instance
> 
> 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.
> 
> The best I've come up with is:


**
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:4d_tech-unsubscr...@lists.4d.com
**

Re: Get Info from a 4D Client - aka Interclient communication

2017-08-13 Thread John DeSoi via 4D_Tech
Maybe just SET PROCESS VARIABLE(-1;<>webServerInfoObject) to put the 
information on the server. Then a process on the server can monitor it or you 
can use a different client to read it using GET PROCESS VARIABLE.

John DeSoi, Ph.D.



> On Aug 13, 2017, at 8:18 PM, Randy Engle via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I need to get some info from a specific 4D Client instance
> 
> 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.
> 
> The best I've come up with is:

**
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:4d_tech-unsubscr...@lists.4d.com
**

Get Info from a 4D Client - aka Interclient communication

2017-08-13 Thread Randy Engle via 4D_Tech
Hey smart guys!

Maybe I'm just being a dope, but I'm not coming up with an easy solution:

I need to get some info from a specific 4D Client instance

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.

The best I've come up with is:

EXECUTE ON CLIENT, and have the target client create a record in my 
[Intersystem_Message] Table with the info I need.
Then wait a few ticks and query for that record and read the info.

Or have the Target client do an EXECUTE ON CLIENT back to the calling client.

Seems rather clunky.

Would love to have a similar function as the "Execute on Server" attribute, 
only for a specific client.
But that's probably too much to ask...  

I'm probably missing something ridiculously obvious.

I'm sure at least some of you brilliant lads have come up with a cool solution 
for this.

Love to hear about it.

Thanks!

Randy Engle
XC2 Software LLC – XC2LIVE!

PS:  ANNOUNCEMENT!!! SUMMIT VINOFEST!!!
I'm not one to wait until the last minute, so

At next year's 4D Summit (April 2018)
Yet one more time, there will be the Summit "Vinofest"
I've booked a suite, so we won't be trying to cram in 20 people in a small 
hotel room.
(And maybe we won't have security show up to kick everyone out!)
To all of you who have shown up in the past, and all of you who would like to 
indulge this next time, you're invited!
Will be on Monday April 2 (evening of the meet and greet event)
Details to follow in the future.

**
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:4d_tech-unsubscr...@lists.4d.com
**