Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] Re: packet batches? (was: [Patch] Making city report list
Home

[Freeciv-Dev] Re: packet batches? (was: [Patch] Making city report list

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: packet batches? (was: [Patch] Making city report list faster)
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Mon, 10 Jun 2002 20:52:41 +0200

On Mon, Jun 10, 2002 at 08:38:47PM +0200, Christian Knoke wrote:
> On Mon, Jun 10, 2002 at 08:25:01PM +0200, Raimar Falke wrote:
> > On Mon, Jun 10, 2002 at 08:07:10PM +0200, Christian Knoke wrote:
> > > On Mon, Jun 10, 2002 at 07:52:40PM +0200, Reinier Post wrote:
> > > > 
> > > > > It also introduces the problem of possible cheating: a client can
> > > > > batch up its requests indefinitely, to have all of them processed
> > > > > without intervention.  So the server would need to impose
> > > > > some requirements on what kinds of requests can be batched together.
> > > > 
> > > > The amount of possible "cheating" is limited by the fixed TCP packet 
> > > > size.
> > > > At the moment, the client only calls connection_do_buffer() in the CMA.
> > > > Perhaps the server should prohibit the client from sending multiple
> > > > move requests in the same TCP packet.
> > > 
> > > How do you think it's cheating? If the user buffers everything up to
> > > the end. If the data receive the server too late, he is bad off.
> > > Also, his commands can fail. Movements can fail due to ZOC. And this
> > > happens in battle where you may think it is an advantage to batch the 
> > > move requests. In any case, he must process his batch before turn done.
> > 
> > > Do I miss something?
> > 
> > It is indeed possible for a faster client (faster means here faster to
> > push requests into the incoming socket buffer of the server) to get
> > more requests executed per "cycle".
> 
> But where is the advantage? Neither server cycles nor network volume
> is a limited ressource. I still don't get it.

"cycle" is not a CPU cycle but a

 select(connections);
 for each connection {
   if data can be read from this connection {
     while there are packets {
       execute packet
     }
   }
 }

So if you can depose a lot of packets at the server AND you have a low
connection number AND this is the first cycle after a new turn you can
get a lot of move requests executed by the server before your enemy
can do anything.

It would be fair to limit the inner loop to only one execution.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Just because you put a flag on the moon doesn't make it yours, it just
  puts a hole in the moon."


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