Closed heggink closed 3 years ago
Proposed a change to plugin.py that fixes the issues for me. No more errors or lost messages since.
Proposed a change to plugin.py that fixes the issues for me. No more errors or lost messages since.
What was the propose, I do not find any PR?
Switching to the local api, I find a number of errors in the log:
When debugging, it appears that, just before onConnect is called, the slide disconnects. onCommand is still called with a status =0 so the plugin thinks it can send data resulting in the listed errors. I added a check for Connected() right after the first debug statement:
Which shows up just before the error statements so the connection is indeed closed :-(. From what I understood reading the code, the mechanism is to pop a message from the messageQueue, put the message in the connection, create a connection, connect and let the onConnect handle the send (because it would only get called if there was a connection which there is not). Not sure what the best way to reconnect would be since simply calling connect() results in creating a new connection entry where the old would never be freed (the pop() isn't until onMessage). For now I have added a simple return under the check above but that would mean that the message itself would get lost. Not a problem if a heartbeat but less helpful if an actual command.
Thoughts? The python plugin framework is a piece of work sometimes.
H