Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] PATCH: network i/o
Home

[Freeciv-Dev] PATCH: network i/o

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] PATCH: network i/o
From: Lauri Tarkkala <ltarkkal@xxxxxxxxxxxxxxx>
Date: Sun, 3 Sep 2000 23:08:54 +0300

I finally rolled up a patch which incorporates all of the work in 
the previous server i/o patches, except for the "dynamic buffer size
feature" from vasc. The patch is against the current CVS version.

The reason for excluding this feature is that the patch is already 
quite large (~50kB), and is becoming increasingly difficult to produce 
with an amount of confidence that "nothing broke". 

Therefore I would like to know if there is any interest in including
this code in CVS, and if not all, then what parts. As then it would be
far easier to keep working on smaller patches against the head 
revisions in the CVS, instead of the current rather large patch.

The patch contains the following changes:

- The rewrite of the server i/o code in sernet to perform asynch
  i/o for both directions. The code is modified to be 
  reasonably easy to understand and extend, and should break
  as little as possible (nothing? ;-).

- The "netwait" and "tcptimeout" parameters for controlling the 
  tolerance for "bad network connections". They can both be
  disabled and allow network connections as bad as the TCP stack
  will tolerate.

  These two features should fix the problems with clients with
  bad network connections hanging the servers at civserver.freeciv.org

- The "netcompress" parameter, which tunes the zlib compression
  of all network traffic. The zlib compression is negotiated
  using "packet_req_join_game" and "packet_join_game_reply".

  The server "netcompress" parameter supports the values 
  "never compress", "compress if possible" and "require compression".
  The server detects the clients HAVE_LIBZ via the "zlib"
  capability, and then based on this and the netcompress parameter
  either terminates the connection or enables zlib compression
  and via the packet_join_game_reply packet tells the client
  to do the same.

  The default value is to "compress if possible".

- The "list clistat" command, which can be used to peek at some
  simple statistics of the connections to server.

Problems/TODO:

+ A new field was added to the "packet_join_game_reply", which
  could break things. The field is encoded after the capability
  strings, so older clients should be able to parse these.

+ The zlib compression could be made more efficient by removing 
  the use of flush_packets() after the send_all*() calls, and using 
  "dynamic buffer size feature" instead. This would allow bigger
  blocks to be passed to deflate() and allow for less overhead and 
  better compression. 

Lauri

-- 
"The credit belongs to the man in the arena whose face is marred by dust and
sweat and blood, who strives valiantly, who errs, and who comes up short again
and again, who knows the great enthusiasms, the great devotions, and spends
himself in a worthy cause. The man who at best knows the triumph of high
achievement and who at worst, if he fails, fails while daring greatly, so that
his place will never be with those cold timid souls who never knew victory or
defeat." - Theodore Roosevelt

Attachment: freeciv-net-5.patch.gz
Description: application/gunzip


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