NetTalk Central

Author Topic: sockets and browses NT10.09  (Read 4373 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
sockets and browses NT10.09
« on: November 01, 2017, 11:14:39 PM »
Hi,

When user1 has a browse on screen and user2, who has the same browse, updates one of the records that are in the scope of user1, how can I make the browse for user1 update within e.g. 2 seconds (or less), without having user1 to interfere?
Do I use sockets for that?
Or am I asking for something impossible here?

Other question:
When I update a database record by just clicking on it,not using a button which routine do I use to refresh the whole browse?
Is that GenerateBrowse?
In fact I want to simulate one of the refresh options that are available for buttons server code (Field reset/Line reset/Browse reset).

Cheers,
Rene

Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: sockets and browses NT10.09
« Reply #1 on: November 03, 2017, 12:24:33 AM »
ahh - NetRefresh for WebBrowses in other words?
that's on my list of cool features to add.

yes, you'd need WebSockets to do that.


cheers
Bruce

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: sockets and browses NT10.09
« Reply #2 on: November 03, 2017, 02:56:37 AM »
Hi Bruce,

I was digging through the NetTalk User group videos yesterday to get an idea about how to work with websockets.
Very interesting by the way.
I addition to my question, I would like to know your opinion about the following.

When user 2 updates a record that is also in the scope of user 1 (because they belong to the same group or club or company etc.),
a p_web.SetHostValue('ourgroupfilter', p_web.gsv('ourgroep') & someTimestamp) is done.

All users of this application  have a (invisible or hidden)  display of this host value. Also the ones that do not belong to the group of user1 and user2
When the value changes and the first part is equal to their group scope filter value, the browse must be refreshed.

You will probably see some or many potholes here. But this is the direction I would go.
Now all I have to do is to detect a change in the Hostvalue. and how to trigger the refresh.

Cheers,
Rene

Btw: you didn't answer my second question.
Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: sockets and browses NT10.09
« Reply #3 on: November 05, 2017, 09:50:06 PM »
Hi Rene,

>> Btw: you didn't answer my second question.

ha ha - yeah, I didn't see it. Rather post one question in a post at a time. That makes threads more "on topic". (I'll let you re-post the second question in a separate thread.)

Regarding your WebSockets - what you are describing are "channels.
ie - at one extreme you have session values - which are in scope for just one user.
at the other extreme you have host values - which are in scope for all users
In the middle are "channel" values, which have an extra "scope" (called "group").

These allow you to create "groups" of users and so end up a cope which is multi-user, but limited to some subset of users.

cheers
Bruce

PS - I went into this,and web sockets in general, a fair bit at the CIDC training. I'm building "chat" objects around this concept, and once that is done I'll do some more webinars on this.

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: sockets and browses NT10.09
« Reply #4 on: November 06, 2017, 02:58:24 AM »
Ok,
It seems that you and I are just in time at the same spot.Can't wait !
Rene Simons
NT14.14