+ while ptimeout > 0:
+ time.sleep(pcheckint)
+ ptimeout -= pcheckint
+ if sppoo.poll():
+ logging.debug("XMPPmessage sent: '%s'" % msg)
+ return
+ #timeout reached
+ logging.error("sendxmpp subprocess took too long (>%fs), sending SIGTERM to pid %d" % (ptimeout,sppoo.pid))
+ sppoo.terminate()
+ time.sleep(1.0)
+ if sppoo.poll() is None:
+ logging.error("sendxmpp subprocess still alive, sending SIGKILL to pid %d" % (sppoo.pid))
+ sppoo.kill()