04-04-2022 04:23 PM
Instead of constantly polling the server with HTTP GET requests, I would like the server to push events to the G web client. I already have the server that can push using POST when the event occurs, but how could the G web listen to this? Wondering if there are any examples or other recommendations (no Systemlink or websockets). thanks
04-05-2022 07:50 PM
I thought of a workaround using websockets and still keep the HTTP Rest interface. The G web client will send a POST to the server with the websocket info (IP, port). The client/server will establish connection. The server will keep an array of connection references for each client. When the server has an event, it will send to all clients by websocket. sort of like a pub/sub. Client should receive real-time events without short polling the server, and without the server having to know of the clients ahead of time (client sends the info).
04-19-2022 09:15 AM
I'm using Websockets for my Website as well. Maybe take a look at WAMP to get some ideas how to organize the pub/subscribe model. There is a VI Package for LV (link) but unfortunately on the G Web side you have to implement it by yourself. Maybe you project isn't that big (like mine) and you can create some simple "protocol" using JSON strings to communicate over Websocktes.