Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2000:
[Freeciv-Dev] Re: gtk tax rates display functions
Home

[Freeciv-Dev] Re: gtk tax rates display functions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rja@xxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: gtk tax rates display functions
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sat, 29 Apr 2000 18:20:33 +1000 (EST)

On Tue, 25 Apr 2000 Richard Atkins <rja@xxxxxxxxxxx> wrote:

> Does anyone know an easy way to wait for updates from the server? Or is
> this dynamic thing just too network intensive?

In general the freeciv approach is "don't do that".  Instead, 
arrange for a response from the server to trigger whatever
needs doing.

That is:  In the client, do some stuff, send packets to the 
server, maybe set some variables, etc, then return, to go back 
to the client "event loop".  Arrange so that when (if) the 
server replies, the reply should cause an appropriate function 
to be called, which notes the client state (variables etc), 
and does whetever is needed. 

Ideally this should be as robust as reasonable, eg against the
server not replying, or replying in an unexpected way, etc.

(There are various advantages to this approach, but I can't
be bothered trying to write them coherently just now, so leave 
that as an exercise for the reader ;-)

-- David



[Prev in Thread] Current Thread [Next in Thread]