Closed yusufcananar closed 3 months ago
The webserver functionality is not very well-supported for a variety of reasons, but we will look into this and determine what is causing the holdup. Thanks for bringing it to our attention.
Do the web socket and socket variable servers use the same approach to gather variables from main sim thread? I haven't looked it up but aren't they using the same layer to collect data from sim?
They should use the same underlying functionality now (in fact this comment made me find an old issue that should've been closed like 2 years ago about this). We've identified the problem, and we're working on a fix right now.
@Fjolnirr The linked branch and pull request should fix the issue. Please test it out and let me know if you still run into any problems.
I have installed trick on this branch https://github.com/Mrockwell2/trick/tree/1720_Websocket_Freeze_Issue Still got the similar results.
I have installed trick on this branch https://github.com/Mrockwell2/trick/tree/1720_Websocket_Freeze_Issue Still got the similar results.
Did you do a make clean before rebuilding?
Of course. I have cloned your repo and installed everything from 0.
I tried on both Firefox & Safari (on Mac) with WS Experiments
in SIM_cannon_numeric
as #1294 suggested without any issue. Without the fix in this PR, I did see the web client didn't get data updates after freeze. However with the fix, the client received data updates after freeze without any issue.
On the other hand, Chrome doesn't work for me for some reason. Those variables specified in the respective wsexp.html
didn't even show up on Chrome.
I didn't try postman
though.
We also tried postman
also, and didn't see any issues. We're going to close this one for now, but feel free to comment again if you still have issues.
I was playing with the websocket server features of trick and wanted to review the issues about it. While trying to reproduce the issue #1294 I find another problem that, After freeze websocket client doesnot receive data for a long time and suddenly continues to receive again.
Steps to reproduce:
Run web server sim(SIM_cannon_analytic edited for websocket usage).
Connect to sim as websocket client(i used postman)
send
var_unpause
command to receive data from websocket server.send command below to track a variable.
Start the sim
You should see flow of messages like this over websocket
Freeze the sim and websocket stops sending you the response messages(but keeps you connected).
Start sim again. Still no incoming data to client.(and still connected).
After waiting for 6 minutes client receives data again. Check the figure below:
Another version of the step after freeze dont start back the sim.
Let the sim stay in freeze.
Websocket client doesnot receive messages for a while(but not much as mentioned steps above)
16 seconds to receive messages again. Check the figure below: