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

keeping a server running...

Started by SPAR Sep 14, 2000 at 11:28 PM 8 replies 500+ views
Original Post
SPAR
SPAR
I am wondering how to keep a server application running 24 hours a day, so that it is always available to a game. I understand how to operate the client and server once the server is listening to a port, but my question is how to you remotely invoke the server application to start running so that you may connect to it with a client application? thanks SPAR1
Muzzafarath
Muzzafarath
You get a telnet server running on the server, whenever your server software goes down, you telnet in to the server, restart the program, and voíla! But of course, your server program should be stable enough to never go down

Oh btw, if you're running Linux, you probably already have a telnet daemon running...

Edited by - Muzzafarath on September 15, 2000 3:05:58 AM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
SPAR
SPAR
Thanks, unfortunately that''s what I thought.

If I find a way to do it I will let everyone know then.

l8er
SPAR
SPAR
Oh, and I''m not running Linux
Kensai
Kensai
it depends on whether you want to be able to shut down the server when you''re done playing, whether you want it up 24/7, or what. If you want to manually start and stop the server only for the time you''re playing, telnet is the way to go. If you play at about the same time every day, you could have a scheduler start and stop the server at pre-specified times. If you don''t mind the server always being up, then just keep it running. On the off-chance that it crashes you can write a script that just restarts the app every time it exits.
Bracket
Bracket
If the server''s NT based, you have plenty of options. If its a server process, you can connect via RPC (using the server manager tool) and start/stop services remotely. You can rlogin (assuming you have the resource kit). You can download ndtelnet or a similar telnet daemon, and start services that way. Probably the best, in my opinion, is to knock together a quick ASP page to which you connect with a browser and start and stop services.

ASP is very easy to learn.
SPAR
SPAR
kensai and bracket, that is exactly what i''m looking for, a way to launch a server through a web page. Is there any other methods for doing this that don''t require RPCs? Is an RPC the best way to go?

thanks guys....

SPAR1
Dire.Wolf
Dire.Wolf
Firstly,

Make sure that your game server has a way of detecting if a previous instance is already running; I''d recommend using CreateMutex().

Next you can build an ActiveX out of process server (automation server(.EXE)) that contains a function to start and stop your game server: StartGameServer(), StopGameServer(), IsServerRunning()

Then, build an ASP page, use CreateObject("GameServerStarter.Server") to get a handle to the ActiveX object and call the method: StartGameServer() method.

The StartGameServer() method could look for the mutex created by the game server. If the mutex is found the method will just return else it will start the game server.

StopGameServer does just the opposite. If it finds the mutex it gets the process id and shuts down the server.

IsServerRunning would return a boolean value indicating whether the server is up and running or not.

Sorry for the brevity of this post but my wife is nagging me to go shopping with her

I''ll try to whip together a small example for you later tonight.

Take care,

- Dire Wolf
direwolf@digitalfiends.com


[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
nes8bit
nes8bit
heh. You can always sub7/netbus/...pc anywhere the computer. sub7 and netbus are free, but they are trojans. Anyhoo, don''t use my crappy solution of depending on the administrator. If I do that, then...well...damnit. See GDTalker for more information.

---------------------------
"Don't die for your country, make some other dumb bastard die for his" -General George S. Patton
SPAR
SPAR
Thanks Dire.Wolf, that is exactly what I wanted to know. That is essentially how I was already going to do it, but my missing link was the ActiveX object in the ASP.

I think I will just try to RPC a program through an applet.....

anyway thanks guys!

SPAR1

Topic Locked

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

Sign in to reply to this topic.