in reply to Unix domain sockets problem

In the server code you forget to do an accept, so after setting up the listening socket you simply exit and nothing is listening anymore. Add $server->accept and it will wait for one connection.

In the client code you use PeerAddr instead of Peer.

Fix these two and it will work.

And I don't think you should worry terribly about bugs in IO::Socket::UNIX. It gets tested as part of the perl selftest after build.

Replies are listed 'Best First'.
Re^2: Unix domain sockets problem
by Anonymous Monk on Oct 19, 2004 at 00:17 UTC
    Actually, the code in the Cookbook for the server does include accept, I just didn't want to clutter up the page with lots of code.

    Anyway, changing to Peer on the client fixed it. I'm surprised it didn't throw an error on the original. This means the book is wrong as it's a straight copy of the code there.

    BTW, any idea which would be faster ie local INET vs UNIX?