[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to spawn a server?



On Monday 09 September 2002 14:28, Francesco Orsenigo wrote:
> My game works on a tight server/client system.
> This means that the player usually needs to run only the client.
> But when the player chooses to Host a game, the client program must create
> a server and connect to it immediatly.
<snip>
> Any idea?

You could put all the server functionality (binding the port, listening to it, 
the communication) in a shared library. That way the client can just load 
that code (and quite possible share some classes regarding communication and 
game objects) and even unload it if you use dlopen to load it on demand.

Disadavantage is that when the client crashes, the server will be dead too. 
But it would make sure the server is only running while the client needs it.

I hoping to move monopd/Atlantik into that direction myself, using the server 
lib in the client as well as a small app which uses it to be run as dedicated 
server.

Rob
-- 
Rob Kaper     | Gimme some love, gimme some skin,
cap@capsi.com | if we ain't got that then we ain't got much
www.capsi.com | and we ain't got nothing, nothing! -- "Nothing" by A