5 @INC = '../lib' if -d '../lib';
6 require Config; import Config;
7 if ($Config{'extensions'} !~ /\bSocket\b/ && $Config{'osname'} ne 'VMS') {
17 if (socket(T,PF_INET,SOCK_STREAM,6)) {
20 if (connect(T,pack_sockaddr_in(7,inet_aton("localhost")))){
23 print "# Connected to ",
24 inet_ntoa((unpack_sockaddr_in(getpeername(T)))[1]),"\n";
26 syswrite(T,"hello",5);
28 print $buff eq "hello" ? "ok 3\n" : "not ok 3\n";
31 print "# You're allowed to fail tests 2 and 3 if.\n";
32 print "# The echo service has been disabled.\n";
43 if( socket(S,PF_INET,SOCK_STREAM,6) ){
46 if (connect(S,pack_sockaddr_in(7,INADDR_LOOPBACK))){
49 print "# Connected to ",
50 inet_ntoa((unpack_sockaddr_in(getpeername(S)))[1]),"\n";
52 syswrite(S,"olleh",5);
54 print $buff eq "olleh" ? "ok 6\n" : "not ok 6\n";
57 print "# You're allowed to fail tests 5 and 6 if.\n";
58 print "# The echo service has been disabled.\n";