[Freeciv-Dev] Re: gtk tax rates display functions
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
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 ;-)