![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: select appears to ignore pending data on socket.by Somni (Friar) |
on Nov 04, 2007 at 03:33 UTC ( #648838=note: print w/replies, xml ) | Need Help?? |
Please stop using recv. It works fine, but it has arguments you are almost certainly not using. Use sysread
instead.
sysread will return on short reads. Meaning you do have to pay attention to the return value; you are not guaranteed to get all that you asked for. As long as select says there's something to read, sysread will not block. You are also, therefore, not guaranteed to get a full line on each sysread, so you will have to do your own buffering. Event.pm and POE are designed to abstract away most of these details, as it's tedious and error-prone to implement them yourself.
In Section
Seekers of Perl Wisdom
|
|