takaoueda / my-deja.com writes:

> Meanwhile I reached page 111.  Here we find two network programs.  I
> tested a program similar to the second by activating Apache.  I do not
> have Oracle installed, so I can not test the first.

You don't need oracle: any user will do. The program simply uses the
finger daemon to return information about a user.

> But I found a simple complete program in socket level in page
> 480. When I tested it, I got the error message.
>  unixsock.rb:11: in `open': Connection refused - "/tmp/sample."

1. Are you running on a Unix platform, with a writable /tmp
   directory?

2. Is there an existing file /tmp/sample that would stop the pipe from 
   being created.

I just ran the code (available from
http://www.pragmaticprogrammer.com/ruby/samples/smp480.html), and it
worked on my box, producing:

  ["hello", ["AF_UNIX", ""]]

Afterwards, I looked in /tmp:

  dave[ruby/samples 11:52:11] ls -l /tmp/sample
  srwxr-xr-x   1 dave     users           0 Dec 29 11:52 /tmp/sample


> By the way, threads are discussed in the next chapter. If you would
> modify and divide it, then I think I could make the server program a
> daemon by "ruby server.rb &."

Yes you could, although a true daemon does a few extra things too to
disassociate it from the controlling terminal and session.


Have fun


Dave