Hey there,
I have two website applications under the same Web page. Both uses the same Default.json file, with enableWebSocket true. Both websites needs to be refreshed frequently. For one website Application.IsWebsocket returns true, while on the website it returns false. The one not working got installed later. I am opening those websites from the server (localhost), same browser. I can’t figure out the problem alone, please help me!
If you run code in a thread you must call Application.Update(). Browsers only receive a response if there is a request. WebSocket allows for a push update, which requires a push.
If Application.Update() works then it’s using WebSocket.
If you check Application.IsWebSocket in Program.Main it will always be false since the first request is always http.
HTH
So here is my setup:
Dim x As Integer = 2
Do
Invoke(Sub()
PanelContentContainer.Controls.Clear()
PanelContentContainer.Controls.Add(ShownPanelList(x))
End Sub)
ElaspedSeconds= 0
Do While ElaspedSeconds< ChangeSeconds
ElaspedSeconds+= 1
Invoke(Sub()
ProgressCircle1.Value = Math.Floor((ElaspedSeconds/ ChangeSeconds) * 100)
LabelTime.Text = Now.ToLongDateString & ” ” & Now.ToLongTimeString
End Sub)
Threading.Thread.Sleep(1000)
Loop
If x<> ShownPanelList.Count – 1 Then
x+= 1
Else
x= 0
End If
Loop
Edit 1#: This sub is inside a Thread.
Edit 2#: Adding Application.Update(Me) after setting the Invoke which sets the time seems to solve this issue, but still it’s not running in websocket mode.
Hi László,
I’m not sure I fully understand your setup. Can you please attach a small sample replicating the issue?
Best,
Levie
Please login first to submit.