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: Reinier Post <rp@xxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: packet batches? (was: [Patch] Making city report list faster)
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Date: Tue, 11 Jun 2002 02:49:24 +0100 (WET DST)

On Mon, 10 Jun 2002, Reinier Post 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:

> As I said, I don't understand TCP/IP very well.  Perhaps even on
> slow connections, a batch of packets sent at the same time
> will usually arrive at the same time.  In case of transmission
> errors, packets will be clustered *more*, not less.

Depends if something like the Naggle algorithm is being used. Since we use
O_NONBLOCK packets should be sent pretty much as they are written.

This is what you want when you are for e.g. sending unit movement packets.

For batch sends you should use *connection_buffer()  *connection_unbuffer()
calls around your packet batch sends.

> If I understand correctly, the output is a bigger issue.
> I don't think the send_packet_() calls can block, but the server
> sometimes sends flush_packets(), and that may cause incoming packets
> to queue up.
>
> > Another thing which is unfair (at least theoretical) is that the
> > connections are scanned in a fixed way. So if you got a low index in
> > the connections array your requests are always execute before the
> > requests of another player. But this only matters if the server gets
> > more than one request from all player in one cycle.
>
> This can be fixed by using shuffled_player().

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





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