Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: select appears to ignore pending data on socket.

by Somni (Friar)
on Nov 04, 2007 at 03:33 UTC ( [id://648838]=note: print w/replies, xml ) Need Help??


in reply to Re^2: select appears to ignore pending data on socket.
in thread select appears to ignore pending data on socket.

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.

  • Comment on Re^3: select appears to ignore pending data on socket.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://648838]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-26 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found