NetTalk Central

Author Topic: WS examples  (Read 4902 times)

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
WS examples
« on: January 28, 2017, 05:52:12 PM »
Hi,

Could anyone help me to find:

- WebSocket examples and documentation? I want to build the amazing examples from Webinar 291.
- Chat example using WS? I found using NetAuto in desktop app but not in WS.

I have Clarion 8EE/NT 9.17

Thank you.

Best regards,

Marcos

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: WS examples
« Reply #1 on: January 29, 2017, 10:38:32 PM »
Webinar 291 was by Dries Driessen, so you'd be better asking him for the examples.
But he used a different (much earlier) version of the WebSocket support (which he wrote) so I don't think they'll necessarily be compatible with current NetTalk.

>> Chat example using WS?

I'm working on a Chat widget based on web sockets - but I've not had time to get it finished yet.

cheers
Bruce

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Re: WS examples
« Reply #2 on: January 30, 2017, 06:23:33 AM »
I've been trying Dries examples using NT WebSocket clw and js but lack some methods like broadcast and how to handle wss without cryptonite because I'm using my own crypt lib.

I imagine that in NT broadcast means get all connections/sessions and send the message but I don't figure out on how to do it.

Do you have any example using NT WebSocket client and server? It helps me a lot. I'm using Clarion 8EE.

My intention is to get Dries examples working with NT WebSocket and use in one of my applications that I have to broadcast a message from one user to all logged in users in a SecWin Group.

Thank you.

Best regards,

Marcos
« Last Edit: January 30, 2017, 06:30:12 AM by Sibuya »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: WS examples
« Reply #3 on: January 30, 2017, 09:58:44 PM »
Hi Marcos,

>> I've been trying Dries examples using NT WebSocket clw and js but lack some methods like broadcast and how to handle wss without cryptonite because I'm using my own crypt lib.

Do you have Dries's example then?
I think the equivalent of Dries's "broadcast" is NetTalk's "HostValues". HostValues are like session values, but span across all sessions. So if you update a HostValue then that value is pushed to the client.

But the JS on Dries's end is likely to be completely different, and would likely require a bit of work to change to the current NetTalk stuff.

To replace the Cryptonite code see netWebSocket.clw - you would need to alter the code in there.

Frankly, I think trying to start with Dries's example will likely cause you more pain than it saves. I recommend instead re-building a program, to do the same thing, using the support in NetTalk.

cheers
Bruce

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Re: WS examples
« Reply #4 on: February 03, 2017, 04:20:44 AM »
Hi Bruce,

To use support in NetTalk I don't have any idea on how to use it. Do you have any example?

Thank you.

Best regards,

Marcos

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: WS examples
« Reply #5 on: February 05, 2017, 09:59:54 PM »
The best way to learn is to review the Web Sockets topics discussed in the webinars.
Go here
http://www.capesoft.com/accessories/NetTalkUserGroup.htm
and search on "socket".

cheers
Bruce