Hello Vic,
Are your clients desktop apps or is this all in a web application?
I currently have a desktop app that watches a host value via websocket. I send and receive a JSON string using websockets. That JSON string, when received, goes into a group. I then validate the data received to determine if that "message" from the websocket is intended for that one app or for all apps watching the host value. Each app is assigned a DeviceId and that is used in the validation. This is in the ReceiveHostValue embed on the client side. I actually don't do anything in the server itself.
NetSocket.ReceiveHostValue PROCEDURE(String p_HostValueName,String p_Value)
! [Priority 5000]
json JSONClass
CODE
! [Priority 2500]
! Parent Call
PARENT.ReceiveHostValue(p_HostValueName,p_Value)
! [Priority 7500]
local.SendDebugString('Host Value Received')
local.SendDebugString(clip(p_value))
st.SetValue(p_value)
Case clip(p_HostValueName)
of 'devicecommands'
json.Start()
json.TagCase = jf:CaseLower !jF:CaseAsIs
json.RemovePrefix = true
if json.Load(devicecommands, st,'devicecommands') = jf:OK
If clip(devicecommands.command) <> ''
if Upper(clip(devicecommands.command)) = 'UPDATE'
local.SendUdp('Update Command Received ',2000)
gps:laststatus = 'Updating'
local.SetSocketValues()
mystate = mystate:CheckingInternet
Elsif Upper(clip(devicecommands.command)) = 'RESTART'
local.SendUdp('Restart Command Received ',2000)
mystate = ''
ThisWindow{PROP:Timer} = 0
gps:laststatus = 'Restarting'
local.SetSocketValues()
gSelfService.RestartService()
Elsif Upper(clip(devicecommands.command)) = 'RESETGPS'
gps:laststatus = 'Resetting GPS'
local.SetSocketValues()
local.ColdStartGPS()
end
End
End
End
Maybe that helps.
Don