Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sockets + Read

by Roger (Parson)
on Aug 18, 2005 at 00:32 UTC ( [id://484646]=note: print w/replies, xml ) Need Help??


in reply to Sockets + Read

Firstly, the socket stream you have opened is most likely in blocked mode, which means your server trying to access the socket is blocked until there is data coming in from the socket.

Secondly, you are reading the socket incorrectly. If should be
while (read($client,$buffer,1024) == 1024) { # loop only if the incoming data is more than 1k $read .= $buffer; } # at this point, the buffer contains data less than 1k # this is the last read done by the while loop. $read .= $buffer;


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-18 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found