P is for Practical | |
PerlMonks |
Re^3: Checking if a socket has some data to readby 5mi11er (Deacon) |
on Jun 14, 2013 at 16:16 UTC ( [id://1038990]=note: print w/replies, xml ) | Need Help?? |
Hmm, no, I think you're confusing can_read with the routine that actually does the reading, you're confusing a scalar variable with an array, and I can't tell if you've turned buffering off on the $lsn file handle, but I'm guessing not. Your code:
Ping code:
So, you've, at best, got a boolean result from the can_read, but then you use that as if can_read returned an array of data from the wire, rather than use a recv() call to actually read the data properly. I'm also betting that you're Suffering from Buffering, which means unless you've tested by sending tons of stuff, the buffer never filled up, and it *LOOKS* like you've not received anything. -Scott
In Section
Seekers of Perl Wisdom
|
|