Excellent. You missed out communication by way of plain files :-)
Here's a few comments:
> And here's a corresponding server to go along with it. We'll
> leave the address empty (C<"\0" x 4>) so that the kernel can choose
> the appropriate interface on multihomed hosts:
Its not an empty address. Its a specific address called INADDR_ANY
(its in the new Socket.pm) which specifies that the kernel
should use _all_ interfaces on single/multihomed hosts.
> = sockaddr_in(0, ); # 0 means let kernel pick
>
> socket(SOCKET, PF_INET, SOCK_DGRAM, ) || die "socket: ";
> bind(SOCKET, ) || die "bind: ";
The bind is not necessary. The port is allocated automatically
anyway (I think as soon as you do a 'send' for udp sockets).
> =head1 WARNING
>
> The SysV IPC code was written long ago, and is definitely clunky
> looking. It should at the very least be made to C<use strict> and
> C<require "sys/ipc.ph">. Better yet, someone should create an C<IPC::SysV>
> module the way we have the C<Socket> module for normal client-server
> communications.
Someone has. Its been around for a while now. I never took it out of
alpha because of lack of feedback. Should be available at least
at
ftp://ftp.icnet.uk/icrf-public/biu/perlmods/IPC_SysV.tar.gz
and probably at your local CPAN store.
-- Jack Shirazi, JackS@slc.com
Here's a few comments:
> And here's a corresponding server to go along with it. We'll
> leave the address empty (C<"\0" x 4>) so that the kernel can choose
> the appropriate interface on multihomed hosts:
Its not an empty address. Its a specific address called INADDR_ANY
(its in the new Socket.pm) which specifies that the kernel
should use _all_ interfaces on single/multihomed hosts.
> = sockaddr_in(0, ); # 0 means let kernel pick
>
> socket(SOCKET, PF_INET, SOCK_DGRAM, ) || die "socket: ";
> bind(SOCKET, ) || die "bind: ";
The bind is not necessary. The port is allocated automatically
anyway (I think as soon as you do a 'send' for udp sockets).
> =head1 WARNING
>
> The SysV IPC code was written long ago, and is definitely clunky
> looking. It should at the very least be made to C<use strict> and
> C<require "sys/ipc.ph">. Better yet, someone should create an C<IPC::SysV>
> module the way we have the C<Socket> module for normal client-server
> communications.
Someone has. Its been around for a while now. I never took it out of
alpha because of lack of feedback. Should be available at least
at
ftp://ftp.icnet.uk/icrf-public/biu/perlmods/IPC_SysV.tar.gz
and probably at your local CPAN store.
-- Jack Shirazi, JackS@slc.com