Dear Monks
It's my understanding that the 'readers': <> and read() are filtered through the C stdio library, and that stdio automatically does:
It's also my understanding that IO::Socket::INET sockets are created with autoflush turned on, which eliminates buffering on those sockets. But what about newline conversions? As far as I can tell, newline conversions aren't affected by autoflush(). So it seems to me that if you want to prevent newline conversions while reading from a socket, you have to either:
However, on p. 119 of "Network Programming with Perl", after the author points out that when reading the message body of an http response, you must be prepared to read binary data, e.g. an mp3 file (where you don't want to do newline conversions), the author uses the following code to read the body of an http response:
print $data while read($socket, $data, 1024) > 0;
where $socket is an IO::Socket::INET socket. Isn't the read() there going to do newline conversions?
In reply to IO::Socket::INET newline conversions and buffering by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |