* Daemon mode (`nix-worker --daemon'). Clients connect to the server

via the Unix domain socket in /nix/var/nix/daemon.socket.  The
  server forks a worker process per connection.
* readString(): use the heap, not the stack.
* Some protocol fixes.
This commit is contained in:
Eelco Dolstra 2006-12-04 17:17:13 +00:00
parent 4740baf3a6
commit 0130ef88ea
7 changed files with 182 additions and 53 deletions

View file

@ -39,10 +39,11 @@ RemoteStore::RemoteStore()
/* Send the magic greeting, check for the reply. */
try {
processStderr();
writeInt(WORKER_MAGIC_1, to);
writeInt(verbosity, to);
unsigned int magic = readInt(from);
if (magic != WORKER_MAGIC_2) throw Error("protocol mismatch");
processStderr();
} catch (Error & e) {
throw Error(format("cannot start worker (%1%)")
% e.msg());