Forum: Poser Python Scripting


Subject: Breaking a SimpleXMLRPCServer with a keystroke

FVerbaas opened this issue on Dec 10, 2020 ยท 40 posts


FVerbaas posted Fri, 11 December 2020 at 1:49 PM Forum Coordinator

Was thinking about simulating threads by setting a one second timeout for the server. This should, I would expect, cause

    try: 
        server.handle_request()

to exit with an error status and move thread execution on to checking the keyboard input buffer. The requests given from Poser are not a very high frequency. Functions called include writing or loading a geometry to or from file, and some even start a 30 frames simulation. A delay of a second or so is totally acceptable.

What I find very odd is that the server has a queue for 5 requests, but as ar as I can see no way of checking if there are any requests in the queue. If there was, life would be simple: A timer that checks every second or so if the number of pending requests is greater than 0, and if so send out the request handler. That would, I think, cause a lot less overhead than sending out the complete handler, let it sit its timeout and raise the exception. I have not come across a good documentation, though. Not even sur about the unit of the timeout setting, miliseconds or seconds.

You suggest to reverse roles and use Poser as the server and MD as the client. This would be like in MD starting the exchange by saying to Poser: "tell me what to do!", and Poser returning a code from which MD can determine what to do, right? Would be worth considering.