BEGIN {
chdir 't' if -d 't';
- @INC = '../lib' if -d '../lib';
+ unshift @INC, '../lib' if -d '../lib';
require Config; import Config;
if ($Config{'extensions'} !~ /\bSocket\b/ &&
- !(($^O eq 'VMS') && $Config{d_has_socket})) {
+ !(($^O eq 'VMS') && $Config{d_socket})) {
print "1..0\n";
exit 0;
}
syswrite(T,"hello",5);
$read = sysread(T,$buff,10); # Connection may be granted, then closed!
+ while ($read > 0 && length($buff) < 5) {
+ # adjust for fact that TCP doesn't guarantee size of reads/writes
+ $read = sysread(T,$buff,10,length($buff));
+ }
print(($read == 0 || $buff eq "hello") ? "ok 3\n" : "not ok 3\n");
}
else {
syswrite(S,"olleh",5);
$read = sysread(S,$buff,10); # Connection may be granted, then closed!
+ while ($read > 0 && length($buff) < 5) {
+ # adjust for fact that TCP doesn't guarantee size of reads/writes
+ $read = sysread(S,$buff,10,length($buff));
+ }
print(($read == 0 || $buff eq "olleh") ? "ok 6\n" : "not ok 6\n");
}
else {