Re: Socket Communication

2019-03-19 Thread Paul Dennis via 4D_Tech
Just watched the 4D Method presentation from Matt. Very interesting.
Thanks to Matt and 4D Method.
Paul



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Socket Communication

2019-01-23 Thread spiffyguy via 4D_Tech
Hi everyone,

Just wanted to followup and let you know that I am on the schedule for the
next 4DMethod webinar session on March 13th where I will present my
component and go through the "why" and especially the "how" with examples
and benefits.

https://4dmethod.com/schedule/

Thanks Brent for organizing the 4DMethod blog and creating this platform for
the 4D community to share!

- Matt




--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Socket Communication

2019-01-21 Thread spiffyguy via 4D_Tech
Hi Steve,

I have been working with WebSockets on a component I wrote for 4D.  I love
web sockets over long-polling.

I designed and created a component that can just be dropped into any
database.  I am planning on demo-ing the component with examples on 4DMethod
but figuring out the right date.  As soon as it's confirmed with Brent, I
will let you know if you want to tune in for that presentation.

I use web sockets for a number of things... like syncing data easily between
many web views and for keeping track of some iPads that should be always on. 
As soon as they get powered off, the 4D Server instantly knows and sends a
message to the employees affected.  I also use them in a mobile app I
designed to skip Apple Push Notifications and Google Firebase Notifications
if the app is open.  If it's open I can push a message directly to the app
and skip the middle man.  I also wrote an app that pops up a camera from a
zoneminder when motion is detected, works pretty well for my employer's
need.

- Matt




--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Socket Communication

2019-01-15 Thread John DeSoi via 4D_Tech
Polling does not have to be an immediate request/response. See long polling:

https://www.pubnub.com/blog/2014-12-01-http-long-polling/

With websockets your are going to have a connection open all the time anyway, 
so long polling is no more resource intensive. I would not use it for the 
public web, but for 50 to 100 clients on a local network it seems pretty 
straight forward.


John DeSoi, Ph.D.


> On Jan 15, 2019, at 3:40 PM, Stephen J. Orth  
> wrote:
> 
> This is just "polling" logic and won't work for us, which is why I am asking 
> about web sockets.
> 
> In our world, when a machine goes down we have to immediately contact the 
> browser managing the machine.  In polling logic, it would mean we only check 
> every X interval.  Before anyone says "well just make it a short interval" 
> take into account I may have 50 - 100 browsers all polling continuously.  
> This is a lot of traffic which simply asks the server "anything for me".  
> Keep in mind 99% of the time the answer from the server will be no.  This is 
> a lot of overhead for the 4D Server to be dealing with continually.
> 
> It's much more efficient, considerably less taxing, to just have the server 
> push a request to the shop floor browser only when some action is required...

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Socket Communication

2019-01-15 Thread Kirk Brooks via 4D_Tech
That looks pretty cool. I've built a chat app on PubNub a while ago. (
www.pubnub.com) I haven't looked back at PubNub recently - Pusher looks
like they may have built out a few more tools.

In both cases they have very generous free programs.


On Tue, Jan 15, 2019 at 1:57 PM Welsh Harris via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> This is worth a look:
> https://pusher.com 
>
> - setup a pusher channel in your pusher account
> - browsers subscribe to a pusher channel
> - 4D makes and http request to the pusher channel
> - boom all the browser who have subscribed get the message
>
> Welsh
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Socket Communication

2019-01-15 Thread Stephen J. Orth via 4D_Tech
Welsh,

Hum, interesting idea.  We will definitely check this out...

Thank you so much!

Best,


Steve

*
  Stephen J. Orth
  The Aquila Group, Inc.  Office:  (608) 834-9213
  P.O. Box 690   Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  s.o...@the-aquila-group.com
*

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Welsh Harris via 
4D_Tech
Sent: Tuesday, January 15, 2019 3:58 PM
To: 4d_tech@lists.4d.com
Cc: Welsh Harris 
Subject: RE: Socket Communication

This is worth a look:
https://pusher.com <https://pusher.com/>

- setup a pusher channel in your pusher account
- browsers subscribe to a pusher channel
- 4D makes and http request to the pusher channel
- boom all the browser who have subscribed get the message

Welsh
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Socket Communication

2019-01-15 Thread Jeffrey Kain via 4D_Tech
+1 for pusher.  Very handy for integration.

> On Jan 15, 2019, at 4:57 PM, Welsh Harris via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> This is worth a look:
> https://pusher.com 
> 
> - setup a pusher channel in your pusher account
> - browsers subscribe to a pusher channel
> - 4D makes and http request to the pusher channel
> - boom all the browser who have subscribed get the message

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Socket Communication

2019-01-15 Thread Welsh Harris via 4D_Tech
This is worth a look:
https://pusher.com 

- setup a pusher channel in your pusher account
- browsers subscribe to a pusher channel
- 4D makes and http request to the pusher channel
- boom all the browser who have subscribed get the message

Welsh
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Socket Communication

2019-01-15 Thread Stephen J. Orth via 4D_Tech
John,

Thanks...

This is just "polling" logic and won't work for us, which is why I am asking 
about web sockets.

In our world, when a machine goes down we have to immediately contact the 
browser managing the machine.  In polling logic, it would mean we only check 
every X interval.  Before anyone says "well just make it a short interval" take 
into account I may have 50 - 100 browsers all polling continuously.  This is a 
lot of traffic which simply asks the server "anything for me".  Keep in mind 
99% of the time the answer from the server will be no.  This is a lot of 
overhead for the 4D Server to be dealing with continually.

It's much more efficient, considerably less taxing, to just have the server 
push a request to the shop floor browser only when some action is required...

Best,


Steve

*
  Stephen J. Orth
  The Aquila Group, Inc.  Office:  (608) 834-9213
  P.O. Box 690   Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  s.o...@the-aquila-group.com
*

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of John DeSoi via 4D_Tech
Sent: Tuesday, January 15, 2019 3:31 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: John DeSoi 
Subject: Re: Socket Communication

Steve,

> On Jan 15, 2019, at 3:08 PM, Stephen J. Orth  
> wrote:
> 
> Not sure I understand what you are saying, would you be able to provide me 
> with a high level overview of what you are thinking?

HTTP is a request/response protocol where the server only responds to requests 
from the client. Websockets are full duplex and bi-directional meaning either 
side of the connection can both send and receive asynchronously. See

http://blog.arungupta.me/rest-vs-websocket-comparison-benchmarks/

> 
> Our Server will be performing analytics' and at some point it will trap on a 
> condition that needs to be communicated to the shop floor.  For example, a 
> machine has been idle for more than 5 minutes.
> 
> When this event is flagged, the server needs to tell the browser on the 
> floor, associated with this machine, to take a specific action. Basically the 
> browser will need to present a different window for the operator to respond 
> into.
> 
> So I'm just trying to understand how the HTTP idea you presented would work 
> in this situation...

This can be achieved in a HTTP/browser interface without much trouble. I think 
all you would need to do is set a timer for your web interface to periodically 
check with the server for a change in state. Probably not as efficient as 
websockets, but a fraction of the development effort unless you already have a 
websocket server implementation ready to go.

Here is an example of using a JavaScript timer to perform some action, e.g. a 
periodic http call to your server.

https://javascript.info/settimeout-setinterval

John DeSoi, Ph.D.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Socket Communication

2019-01-15 Thread Stephen J. Orth via 4D_Tech
John,

Not sure I understand what you are saying, would you be able to provide me with 
a high level overview of what you are thinking?

Our Server will be performing analytics' and at some point it will trap on a 
condition that needs to be communicated to the shop floor.  For example, a 
machine has been idle for more than 5 minutes.

When this event is flagged, the server needs to tell the browser on the floor, 
associated with this machine, to take a specific action. Basically the browser 
will need to present a different window for the operator to respond into.

So I'm just trying to understand how the HTTP idea you presented would work in 
this situation...

Thanks!


Steve

*
  Stephen J. Orth
  The Aquila Group, Inc.  Office:  (608) 834-9213
  P.O. Box 690   Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  s.o...@the-aquila-group.com
*

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of John DeSoi via 4D_Tech
Sent: Tuesday, January 15, 2019 2:39 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: John DeSoi 
Subject: Re: Socket Communication

Do you really need the ability for the server to send data asynchronously to 
the client (browser)? If not, then HTTP should work and is already supported in 
the browser and on 4D Server.

John DeSoi, Ph.D.


> On Jan 15, 2019, at 1:30 PM, Stephen J. Orth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Very much appreciated.  I swear I saw something at a Summit, or read 
> something about 4D supporting web sockets?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Socket Communication

2019-01-15 Thread John DeSoi via 4D_Tech
Do you really need the ability for the server to send data asynchronously to 
the client (browser)? If not, then HTTP should work and is already supported in 
the browser and on 4D Server.

John DeSoi, Ph.D.


> On Jan 15, 2019, at 1:30 PM, Stephen J. Orth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Very much appreciated.  I swear I saw something at a Summit, or read 
> something about 4D supporting web sockets?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Socket Communication

2019-01-15 Thread Stephen J. Orth via 4D_Tech
Tim,

Great...let me check this out.

Very much appreciated.  I swear I saw something at a Summit, or read something 
about 4D supporting web sockets?


Steve

*
  Stephen J. Orth
  The Aquila Group, Inc.  Office:  (608) 834-9213
  P.O. Box 690   Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  s.o...@the-aquila-group.com
*

-Original Message-
From: Timothy Penner  
Sent: Tuesday, January 15, 2019 12:55 PM
To: s.o...@the-aquila-group.com; 4D iNug Technical <4d_tech@lists.4d.com>
Subject: RE: Socket Communication

Hi Steve,

There is a feature request for Web Sockets on the forums:
https://forums.4d.com/Post/EN/19129127/1/19129128#19129128

Within this thread, there is also a sample database with a working example of 
using ?Web Sockets in 4D.

-Tim



Timothy Penner
Senior Technical Services Engineer

4D Inc
95 S. Market Street, Suite #240
San Jose,CA 95113
United States

Telephone: +1-408-557-4600
Fax:   +1-408-271-5080
Email: tpen...@4d.com
Web:   www.4D.com


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Socket Communication

2019-01-15 Thread Timothy Penner via 4D_Tech
Hi Steve,

There is a feature request for Web Sockets on the forums:
https://forums.4d.com/Post/EN/19129127/1/19129128#19129128

Within this thread, there is also a sample database with a working example of 
using ?Web Sockets in 4D.

-Tim



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Socket Communication

2019-01-14 Thread Stephen J. Orth via 4D_Tech
Has anyone utilized sockets as a form of communication between 4D Server and a 
browser?  If so, I'm curious what options we have available, either inside or 
outside of 4D.

Thanks!


Steve

*
  Stephen J. Orth
  The Aquila Group, Inc.  Office:  (608) 834-9213
  P.O. Box 690   Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  s.o...@the-aquila-group.com
*



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**