1What it is:
2
3 Modules Net::Gen, Net::Inet, Net::TCP, Net::UDP, Net::UNIX,
4 Net::TCP::Server, and Net::UNIX::Server.
5 Net::Gen is not a good name, I know that, but what's in it
6 really belongs in Socket, I think. In any case, I'm open to
7 votes for a better name. Well, I would be, but it's appeared in
8 a Perl Resource Kit from O'Reilly & Associates, so maybe it's
9 pretty well cast in stone after all now. C'est la guerre.
10
11What's different from other offerings:
12
13 Layering keeps PF_INET things in Inet, and only socket-generic
14 stuff is in Gen.
15
16 Friendly {g,s}etsockopt.
17
18 A TIESCALAR interface for really simple socket communications.
19
20 Properly handles connects to hosts with multiple addresses as
21 long as gethostbyname() returns more than one address. (See RFC
22 1123.)
23
24 Has had testing on threaded perls, and works as well with threads
25 as perl itself (which isn't saying much, yet, given the experimental
26 status of threads in Perl, but that's the limit of resolution for
27 the testing).
28
29What's still missing:
30
31 Support for non-blocking sockets is under-tested at best. The
32 select, fhvec, ioctl, and fcntl methods aren't necessarily all
33 one would wish.
34
35 A proper set of regression & verification tests [partial].
36
37 Proper handling of timeout options [partial]. Timed connect() and
38 accept() seem to be working now, but there's no direct support
39 for, say, sending as much of a block of data as possible in a
40 given timeout period.
41
42 Configuration testing to get the include files right on more
43 systems, and to manage to find the constants which at least some
44 Linux systems have as enums rather than as #defines. (I think I
45 have this one covered now, but that isn't proved yet.) Other
46 UNIX variants may need tweaking, and I've no idea whether it'll
47 work on Win32 Perl. Also, the non-blocking/timed connect() support
48 won't work with SOCKSified perl.
49
50 Better support (besides the plethora of protocol constants) for
51 raw socket communications (required for the ICMP values to be
52 useful).
53
54 Probably several other things I won't have missed (yet).
55
56
57The .pm files themselves are pod-ified (somewhat), with a catalogue of
58the methods.
59
60I'm not a technical writer, nor do I usually play one on the net.
61The documentation could still use a lot of work, I'm sure.
62
63Making it all work requires perl 5.004_04 or later. (There are features
64which are new to 5.004_05 and even 5.005 which are used, but there
65are backward compatibility hooks to keep it working with 5.004_04.)
66
67A simple test script:
68
69 #!/usr/bin/perl
70
71 use Net::TCP;
72
73 $f = new Net::TCP 0, 'finger';
74 die "Can't establish finger socket: $!\n" unless $f;
75
76 put $f "-s\015\012";
77 $f->shutdown(1);
78 print $line while defined($line = getline $f);
79 undef $f;
80
81 die "Can't tie to finger socket: $!\n" unless
82 tie $f,'Net::TCP',0,'finger';
83
84 $f = "-s\n";
85 print $line while defined($line=$f);
86 untie $f;
87
88Should be the same (on most BSD-ish systems, anyway) as
89 finger ; finger
90to the shell.
91
92
93Anyway, bug reports & feature requests to me (spidb@cpan.org).
94HOWEVER, if you have compilation difficulties, check the Makefile.PL
95file again, especially near "my @hfiles". The list of required system
96include files is almost entirely tester-contributed. If it doesn't
97build (yet) on your system/configuration/version, see if you can figure
98out why, following the guidelines just above "my @hfiles" there. Future
99users will thank you, too.
100
101If you do need to send a bug report, be sure to include the output from
102a `perl -V' command. If the failure is during the test suite, also include
103the output from `make test TEST_VERBOSE=1'.
104
105Finally, previous releases of this code had a significantly different
106internal implementation, which was slower (but worked in earlier versions
107of perl5 than this code ever could have). If you were using the internals
108of the implementation rather than sticking to the documented interfaces,
109you will have some work to do before your derived classes will work again.
110
111# Copyright 1995,2002 Spider Boardman.
112# All rights reserved.
113#
114# Automatic licensing for this software is available. This software
115# can be copied and used under the terms of the GNU Public License,
116# version 1 or (at your option) any later version, or under the
117# terms of the Artistic license. Both of these can be found with
118# the Perl distribution, which this software is intended to augment.
119#
120# THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
121# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
122# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
123