Python论坛  - 讨论区

标题:[python-chinese] about python win32service

2006年03月28日 星期二 10:16

python python at sealonline.com.cn
Tue Mar 28 10:16:49 HKT 2006

python-chinese,您好!

	here's the code:
	

	class SmallestPythonService(win32serviceutil.ServiceFramework):
    _svc_name_ = "PythonService01"
    _svc_display_name_ = "Python Service01"
    def __init__(self, args):
        win32serviceutil.ServiceFramework.__init__(self, args)
        # Create an event which we will use to wait on.
        # The "service stop" request will set this event.
        self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)

    def SvcStop(self):
        # Before we do anything, tell the SCM we are starting the stop process.
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        print self.ReportServiceStatus
        # And set my event.
        win32event.SetEvent(self.hWaitStop)

    def SvcDoRun(self):
        # We do nothing other than wait to be stopped!
        win32event.WaitForSingleObject(self.hWaitStop, win32event.INFINITE)
        myServer = Server( 61005 ).run()

         关于这里的self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)"and 
		   self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)   是什么意思呢?
		
          ReportServiceStatus()是什么呢?
	 
       
        python
        python at sealonline.com.cn
          2006-03-28

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号