Hi All,
I'm reading "binary" from a socket, and just like a normal email message on
the SMTP protocol (for example), the data is terminated by \r\n.\r\n
I'm saying "binary" because the data stream does include yEnc data (or
character codes > 127)
I'm having issues to exit my read loop when I receive the termination
characters...
my $numBytesToRead = 512;
my $buffer;
while ($bytesRead = read($TCPSocket, $buffer, $numBytesToRead)) {
if ($buffer =~ m/\r\n\.\r\n$/) {
print $buffer;
last;
}
}
I'm obviously doing this wrong :( Can anyone perhaps show me the light?
--
Chris.