Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Sockets + Read

by Roger (Parson)
on Aug 18, 2005 at 00:32 UTC ( #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? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2022-11-26 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?