🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Untitled

posted in DruinkJournal
Published April 16, 2007
Advertisement
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:
Quote: ...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.
Previous Entry Untitled
Next Entry Untitled
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement