Skip to main content
GameDev.net gamedev.net
🔒 Locked

Detecting a crash

Started by Maega Apr 26, 2004 at 4:54 PM 3 replies 300+ views
Original Post
Maega
Maega
I have an app that crashes on occasion (it''s a server.. and it''s not mine.. so I can''t fix the crash). I want to be able to detect when it crashes and just restart the server app. How would I do this?
elis-cool
elis-cool
look into the CRT signal functions, basicly, you give it a pointer to a function that it calls when there is an access violation and the like instead of doing the default messagebox and aborting the app.
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
Maega
Maega
If this needs to be in the server app, it can''t be done. Does this work globally or what?

krez
krez
you could write a program that checks periodically (every second? every fifteen seconds? every five minutes?) if that server app is running, and if not start it up.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
antareus
antareus
krez, the Tribes 1 server actually ships with a program that does that very thing called InfiniteSpawn. The spawn program would create the process and then wait for it to exit, at which point it would start it again. No need to poll for it.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.