Contec IPC Series User Manual page 93

Panel-pc
Hide thumbs Also See for IPC Series:
Table of Contents

Advertisement

performs the monitoring function of the service such as the communication with
client applications through a named pipe. In order that the thread finishes
gracefully when the service is about to stop, it should periodically check the
m_fStopping varaible and refresh the WDT timer. When the function detects that
the service is stopping, it cleans up the work and signal the m_hStoppedEvent
event object.
void CSampleService::ServiceWorkerThread(void)
{
// Periodically check if the service is stopping.
while (!m_fStopping)
{
// Perform user service function here...
::Sleep(2000); // Simulate some lengthy operations.
}
// Signal the stopped event.
SetEvent(m_hStoppedEvent);
}
To browse the other source codes, please download it from the MSDN above.
========================================
PT-S2000HX/HXC/LX/LXC Series User's Manual
//-- Refresh the WDT
MiAPI_Watchdog_Refresh();
93

Advertisement

Table of Contents
loading

Table of Contents