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(AF_INET,7,inet_aton("localhost")))){
23 print "# Connected to ",
24 inet_ntoa((unpack_sockaddr_in(getpeername(T)))[2]),"\n";
26 syswrite(T,"hello",5);
28 print $buff eq "hello" ? "ok 3\n" : "not ok 3\n";
40 if( socket(S,PF_INET,SOCK_STREAM,6) ){
43 if( connect(S,pack_sockaddr_in(AF_INET,7,INADDR_LOOPBACK))){
46 print "# Connected to ",
47 inet_ntoa((unpack_sockaddr_in(getpeername(S)))[2]),"\n";
49 syswrite(S,"olleh",5);
51 print $buff eq "olleh" ? "ok 6\n" : "not ok 6\n";