If you use sysread you must expect partial reads -- see the fine documentation. (Update: sorry, the documentation doesn't tell you this... I felt sure it did... I feel sure it should. Update 2: I am grateful to brother ikegami for pointing out ( see below) the significance of the word Attempts, which I am ashamed to admit I had missed.)
You could try plain read, which is less "clever".
Or you wrap a loop around the sysread, eg:
which will suck away at FH until it hits eof ($rc == 0) or hits some error (!defined($rc)). (Noting that if the FH is set to be non-blocking you can get "soft" EAGAIN error(s)...)my $rc ; my $buff = '' ; do { $rc = sysread(FH, $buff, 5000000, length($buff)) ; } while ($rc +) ;
In reply to Re: sysread and syswrite in tcp sockets
by gone2015
in thread sysread and syswrite in tcp sockets
by rustybar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |