My problem is getting a socket active in PERL. Never written it
before, and just can't make heads or tails of these Unix-system
calls. Does anybody know about this networking stuff?
Specifically, my code looks like:
$AF_INET = 2;
$SOCK_STREAM = 1;
$sock_addr = 'S n a4 x8';
(($name, $aliases, $proto) = getprotobyname('tcp')) ||
die "getprotobyname fail ($!): $name";
(($name, $aliases, $type, $len, $thataddr) =
gethostbyname($server_name)) ||
die "gethostbyname fail ($!): $server_name";
$that = pack($sockaddr, $AF_INET, $port, $thataddr);
socket(S, $AF_INET, $SOCK_STREAM, $proto) ||
die "socket fail ($!): $proto $server_name";
It takes the DIE on the socket call, with a message that the
TCP protocol is not supported. Obviously, this is a bit of
an obtuse question, but it seems like some of y'all are Unix
PERL-heads. Any ideas? BTW, had to run H2PH myself, and did
not know exactly what that did, but it seemed to create the
proper include files (PERL thought so, and used them).
... Robert