[Freeciv-Dev] Forking of the client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I remember trying to insert a fork into the client quite a ways back, which
worked great except for the fact that it crashed the client.
The reason was that the client was highly serialized. As an example:
ClientA: Hey Server! I need a map update!
Server: Ok ClientA. Here it comes
[Server forks off connection and starts sending to client]
ClientB: Hey Server! I'm moving my unit to x,y
Server: Ok ClientB. Doing it.
[Server sends unit move update to all clients that can see it]
ClientC: Thanks Server Dude!
ClientB: Thanks Server Dude!
ClientA: HEY! This doesn't look like the map to me! I'm confused! Live is
no longer worth living, and I should core!
Needless to say, this was Not Good Behaviour(tm), and I removed it
immediately. Since then, I've come to what I believe a good way to attack
this.
For each client connection, the server would fork, and utilizing
pipes, handle each client through a pipe. Each child would be responsible
for buffering output to it's client.
There would be two main reasons for this. The first is that if a client gets
stuck in heavy data comms (such as a map trade treaty), the server doesn't
"get stuck" while the map exchange is happening. The other would to be to
increase the robustness of the server, since if there's a major malfunction
in data communications, if we have to kill a client connection, we just snip
the child, and not the parent.
Has this been done since I last heavily went through the code?
- [Freeciv-Dev] Forking of the client,
James Blackwell <=
|
|