The problem I’m trying to solve is to allow interactive and blocking use of the cesium client from other languages (matlab, python). I couldn’t get a single function call to work, because you can’t restart the reactor from the python interactive console (ipython), and the matlab-python bridge they have implemented requires you to restart matlab to perform the equivalent of restarting the python interpreter. So, it seemed like the next best thing was to serialize the request to json, then have a python client grab the request, and send it to the cesium client.
This works ok with a little bit of careful consideration due to having to write files to disk. However, I’ve messed around with removing the sleep from the while True loop for the python client watching for files, and ran into issues.
If I run through a loop (in python or matlab) that requests cesium to add a point at some latitude/longitude, this results is processing a lot of json files pretty quickly. Without the sleep(1), the cesium client ends up dropping the connection with one of two errors:
WebSocket connection to ‘ws://127.0.0.1:8080/ws’ failed: Invalid frame header
Something about decoding ‘UTF8’
Any ideas on what would cause this?