本文整理汇总了Python中SimpleXMLRPCServer.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleXMLRPCServer.shutdown方法的具体用法?Python SimpleXMLRPCServer.shutdown怎么用?Python SimpleXMLRPCServer.shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleXMLRPCServer
的用法示例。
在下文中一共展示了SimpleXMLRPCServer.shutdown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StatusCollector
# 需要导入模块: import SimpleXMLRPCServer [as 别名]
# 或者: from SimpleXMLRPCServer import shutdown [as 别名]
'''
_logger.error('StatusCollector has died. Exiting program.')
# Stop the XML-RPC server to exit serve_forever
global stopping
stopping = True
serverXMLRPC.server_close()
# Instantiate the StatusCollector and start the XML-RPC server
try:
# Create our StatusCollector which talks to the Spectracom
collector = StatusCollector('timeserver', '/data/hcr/spectracom_log',
onStatusCollectorFailure)
# The main thread is devoted to just running the XML-RPC server. This
# will finish when a SIGINT is received (i.e., via ^C) or a SIGTERM
# is received (e.g., via a 'kill' command).
serverXMLRPC.serve_forever()
except socket.error as e:
# Ignore socket.error if we're stopping the server, otherwise
# complain and exit
if (not stopping):
_logger.error('Exiting on XML-RPC server socket error: %s' % (e))
serverXMLRPC.server_close()
# Perform a clean shutdown of the XML-RPC server
serverXMLRPC.shutdown()
# Unregister with procmap
procmapUnregister()
_logger.info('Finished ' + time.asctime())