iNTERFACEWARE Products Manual > Installing and Using Chameleon > Language API Documentation > Chameleon Networking Components > Running the LLP Components in a Windows Service |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
It often makes good sense to implement an HL7 interface as a Windows service application. This is a non-graphical application that runs in the background.
As a consequence of using the Chameleon LLP components, it will be necessary to have a thread in your service running a message loop explicitly. In some frameworks such as the .NET framework, it may be necessary to explicitly spawn a separate thread that the LLP components are created and run on. A typical way to do this is:
This is demonstrated in the following diagram: The RunMessageLoop method is blocking. It will loop around internally, dispatching networking events until a POST_QUIT message is sent to the networking thread. Calling StopMessageLoop on LlpServer or LlpClient will send this message to the objects in the message loop. Typically, the service control manager (SCM) will send a stop request via another thread - this is a good place to invoke the StopMessageLoop method.
|