perlmonks12 has asked for the wisdom of the Perl Monks concerning the following question:
The code tell me when there is something to be read and it read it and print on the screen. However, it just print the first line, while the answer is much bigger, the first line is like 45 chars + \r\n\r\n and then it has more 300 bytes or so, that are never displayed. However, if I start tcpdump I can see this data coming, but never displayed. What I'm doing wrong? Thanks.ready = $select->can_read(5); if (! scalar(@ready)) { print "Timed out\n"; } else { $sock = $ready[0]; if (! sysread($ready[0], $msg, 512)) { print "recv failed :$!\n"; } else { print "$msg"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why sysread() + select() only read the first line?
by ikegami (Patriarch) on May 14, 2010 at 03:05 UTC | |
|
Re: Why sysread() + select() only read the first line? ($|)
by tye (Sage) on May 14, 2010 at 03:05 UTC | |
|
Re: Why sysread() + select() only read the first line?
by choroba (Cardinal) on May 13, 2010 at 23:02 UTC | |
by perlmonks12 (Novice) on May 15, 2010 at 02:26 UTC |