Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  
Evil Steve


I was bored yesterday so I started writing code to get TEH MUD to run as a service. And it's not as straightforwards as I thought it would be. I've read the GDNet article, but the MSDN docs seem to imply that thigns should be done differently - particularly ServiceMain (ServiceDispatch in the article). The article's main just exits, but the MSDN's ServiceMain says that I should:
...create a global event, call the RegisterWaitForSingleObject function on this event, and exit. This will terminate the thread that is running the ServiceMain function, but will not terminate the service. When the service is stopping, the service control handler should call SetServiceStatus with SERVICE_STOP_PENDING and signal this event. A thread from the thread pool will execute the wait callback function; this function should perform clean-up tasks, including closing the global event, and call SetServiceStatus with SERVICE_STOPPED.
And I don't really see why. Do I need to do that if I'm spawning another thread from ServiceMain to do my processing?

Anyway, I'm sure I'll work it out eventually.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!