I am writing an extension so that I can communicate with a simulated unitree go1’s quadruped controller via UDP. To do this I have used the A1 extension example with which I spawn a thread at init to run the udp socket which then receives (or doesnt) commands that update the robots controller.
However, whenever I save a change in vs code the extension updates and will not load correctly because the UDP port is still in use. I have tried closing the thread and killing the UDPs while loop with a variable stored in a shutdown signal (that is updated in post_clear, post_reset, world_cleanup) but the variable is never updated.
I also tried to create a shutdown event subscription as per the docs but that also does not fire when vs code updates.
What is exactly happening when vs code live upodates the extension? is there an event I can subscribe to so I can gracefully shutdown my UDP? or any other way to accomplish this?