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

Re: reading from a socket, a little at a time

by Anonyrnous Monk (Hermit)
on Feb 15, 2011 at 19:06 UTC ( #888358=note: print w/ replies, xml ) Need Help??


in reply to reading from a socket, a little at a time

A read on a socket does not necessarily read the number of characters requested, but it does return the number of characters actually read (which may be fewer, if not enough data is available at the moment).  Other than that, your impression is correct that a subsequent read would continue where the previous one left off.

BTW, are you sure you want to do a readline (i.e. <$client>) before doing $client->read(...)?


Comment on Re: reading from a socket, a little at a time
Select or Download Code
Re^2: reading from a socket, a little at a time
by Anonymous Monk on Feb 15, 2011 at 19:37 UTC

    I think at this point my mind's gotten to the mushy point and I'm not thinking clearly about what I'm trying to do versus trying to implement. Or rather, I know what I want it to do, but not near getting it implemented right.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-11-23 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (129 votes), past polls