[MUD-Dev] Fw: 16K mud server competition !

Spin spin at fastlink.com.au
Wed Apr 12 01:27:18 CEST 2000


On Mon, Apr 10, 2000, Derek Snider wrote:
<snipped>
> What's the smallest size that anyone's been able to get MUD networking
> code down to? (Written in C or C++)  Does it include buffered input/output?
> Full error checking?   ...just curious...  I feel that the networking code
> is going to take up around 4K of valuable space... unless I'm way off.

  Useless mud (posted in r.g.m.a) includes buffered output, full error
checking(and reporting, possibly 150 bytes in strings) but no characters
(connections are identified by their file descriptor). It supports three
commands close(closes the server),quit and help. Anything that isn't a 
command is echoed to every connection except for the originator. Using
Erwin's supplied count program this comes out to 6346 bytes before
optimizing, 3603 afterwards, though perhaps I could have saved a few more
bytes with globals...and it is nearly as hard to read as raw assembler.

  Implementing the same thing in Python, which I've never used before, nor
have I used a full OO language, took 3284 bytes without any optimization
at all (there are some really big variable names in there). I've since
rewritten it and it is probably a little over half the size it was.

  Even more tempting is a simple implementation of Python's forking TCP
server class which just echos back whatever it recieves, just 516 bytes.
Tie that into some shared memory/files and you could easily have a server
in under 1K (with little error checking).

Cheers,
  Malcolm Valentine.  
--
                                /\   /\
                               /||\ /||\
                               \||/ \||/
                                \/ I \/



_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list