Language choice [was Re: Symlinks]
fbsdusers at rikrose.net
Tue Feb 12 16:32:37 GMT 2002
Just thought I'd drop in my hapennys-worth about the design ideas I've
had so far...
Well, I know some people won't like this, but I'm going to write my DNS
server in C, and be careful of strings and sizes of binary data. Indeed,
I will probably be passing size_t's around.
The architecture will/may be something like:
Starts up any processes in hard-coded watch directory whose
executables have appeared since the last check interval, or last
When a SIGCHLD is recieved, work out which child process died, reap
it, and start up a new one.
Listens to a port and accepts connections. When a new connection
appears, accept it, and attach it to the stdin and stdout of a
proccess that deals with the data 1 line (~= packet in this case) at a
time. Multiplex the data.
These would actually handle the protocol for each section. These would
be, eg a recursive resolver, an authoritative server, a zone transfer
server, and so forth.
Well, that's *basically* how djbdns does things now. Possible
modifications include combining the TCP/UDP Listener with the Child
Processes, to avoid the fork()/exec() overhead. I'm currently (as I
type), thinking that I'd like to do that, and bring in a single threaded
kqueue/kevent (for FreeBSD, poll() for those that have it, select() for
those that don't have poll()) loop with nonblocking sockets.
There's a few other things I'm thinking about, now people have started
me thinking again (see what you started when you asked about wu-ftpd,
whoever it was!)
Uhm. Hm. Anyone wanna banter on IRC? #DeNSe on openprojects.net?
PGP Key: D2729A3F - Keyserver: wwwkeys.uk.pgp.net - rich at rdrose dot org
Key fingerprint = 5EB1 4C63 9FAD D87B 854C 3DED 1408 ED77 D272 9A3F
Public key also encoded with outguess on http://rikrose.net
More information about the Ukfreebsd