The long-polling approach presented another challenge; how do you cancel an
ongoing HTTP request?

As the request is ongoing until given a reply from the server, when the
server finally dies, the client will be left without a response and throws
an exception.

Is it safe to discard the exception, and force the termination?

I ended up using

os._exit(1)

Instead of

sys.exit()

Which works, but probably bypasses more than just clean-up of the sockets
involved.
​
I noticed you’ve gotten a similar question before, Justin.
http://stackoverflow.com/questions/9389414/how-to-kill-a-requests-request-object-that-is-in-progress
​

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODWJBuqe566fRL5eTSkVHmfTLiu-87sMZxoMDCfFE-v0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to