in reply to AF_UNIX Domain Sockets on Windows using IO::Socket::UNIX

(I am using AS 5.8.0)

AF_UNIX is not implemented for win32 (or let me be more careful, at least this win98 I am using).

You cannot really see the fact clearly with IO::Socket::UNIX. If you open up the IO/Socket/UNIX.pm, you will see that, too many times, that module simply returns undef without any indication of the type of failure.

But with this piece of code, you could get more specific indication:
use Socket; socket(SOCKET, AF_UNIX, SOCK_STREAM, getprotobyname("tcp")); unlink("pool"); $pool = sockaddr_un("pool"); #fail, get error message "Socket::pack_so +ckaddr_un not implemented on this architecture", "un" stands for "uni +x", compare with sockaddr_in ("in" stands for "inet") connect(SOCKET, $pool);

Replies are listed 'Best First'.
Re: Re: AF_UNIX Domain Sockets on Windows using IO::Socket::UNIX
by agarsha (Acolyte) on Mar 09, 2003 at 03:25 UTC
    Thanks,

    Yup,

    perl -e "use IO::Socket::UNIX; print sockaddr_un('C:\TMP\unix_socket');" Socket::unpack_sockaddr_un not implemented on this architecture at C:/Perl/lib/Socket.pm line 380.