Re: reading from socket

2015-09-18 Thread Brandon McCaig
On Thu, Sep 17, 2015 at 10:55:58PM +0200, Chris Knipe wrote: > Hi All, Hello, > Running under Net::Server, I have: Unfortunately, you seem to be neglecting to give us full programs to test with which requires us to do guess work. The best way to get help is to do your best to reproduce the probl

Re: reading from socket

2015-09-17 Thread Chris Knipe
> > > Hello Chris. > > Can you provide the yenc files? > Both the good one and the bad one? > http://expirebox.com/download/f7ebd6e37cf576e29df89bb6ae78ded4.html - Includes the two original files (text document, and binary image) - Includes the yEnc version of both files, as received by Perl (po

Re: reading from socket

2015-09-17 Thread David Emanuel da Costa Santiago
at the failed file has 3 extra bytes... It should end at > 77859, but instead, it ends at 77862. So where does those extra > three bytes come from? > > *completely, lost* > > > > > > -Original Message- > From: Chris Knipe [mailto:sav...@savage.za.org] > Sent: Thur

RE: reading from socket

2015-09-17 Thread Chris Knipe
m? *completely, lost* -Original Message- From: Chris Knipe [mailto:sav...@savage.za.org] Sent: Thursday, September 17, 2015 10:56 PM To: 'beginners@perl.org' Subject: RE: reading from socket Hi All, I'm SERIOUSLY starting to cry here :-( It's been over a month

RE: reading from socket

2015-09-17 Thread Chris Knipe
oesn't like, which IMHO means something is manipulating / changing the data is some way or form... The above code really is simple, there's no changing of data there -- Chris. -Original Message- From: Brandon McCaig [mailto:bamcc...@gmail.com] Sent: Wednesday, August 1

Re: reading from socket

2015-08-12 Thread Uri Guttman
On 08/12/2015 01:53 PM, Brandon McCaig wrote: Keep in mind that when reading from a socket you're not reading directly from a hard link to the data. There's an entire network of devices that the data has to travel through to arrive at your machine. Lots can happen on the network. Packets can be

Re: reading from socket

2015-08-12 Thread Brandon McCaig
On Wed, Aug 12, 2015 at 12:40:29AM +0200, Chris Knipe wrote: > On Wed, Aug 12, 2015 at 12:16 AM, Chris Knipe wrote: > Looking at Data::Dumper - it actually looks like latin1 to me *seriously > confused* > > $VAR1 = > "L\\xAF\\xF3\\xDDWJL\\x94\\xEB\\xB2\\xF8\\xE1\\xACZ\\x89Ul;\\xB7\\xDE}1 > '\\x

Re: reading from socket

2015-08-12 Thread Brandon McCaig
Chris: On Wed, Aug 12, 2015 at 12:16:12AM +0200, Chris Knipe wrote: > > Firstly, if the handle isn't being read with binmode set then > > perhaps the \r\n are being converted to \n (if this is > > Windows)? How are you creating/initializing the socket? > > > > Unfortunately, with or without binmo

Re: reading from socket

2015-08-11 Thread Jim Gibson
> On Aug 11, 2015, at 3:16 PM, Chris Knipe wrote: > > Lastly, you're reading from a socket so there's no guarantee that > the buffer string is going to necessarily end at the termination > boundary. Perhaps the protocol guarantees that, but the socket > surely doesn't. You may need to look for t

Re: reading from socket

2015-08-11 Thread Chris Knipe
On Wed, Aug 12, 2015 at 12:16 AM, Chris Knipe wrote: > Lines *should* be terminated by CRLF (provided the 8-bit encoding doesn't > mess up the detection), and the entire data stream is then terminated with > a CRLF.CRLF (similar to a SMTP message for example in terms of protocol). > Looking at

Re: reading from socket

2015-08-11 Thread Chris Knipe
> > Firstly, if the handle isn't being read with binmode set then > perhaps the \r\n are being converted to \n (if this is Windows)? > How are you creating/initializing the socket? > Unfortunately, with or without binmode, there's no difference to the matching (from what I can tell) Socket creat

Re: reading from socket

2015-08-11 Thread Chris Knipe
On Tue, Aug 11, 2015 at 5:28 PM, John SJ Anderson wrote: > On Tue, Aug 11, 2015 at 6:58 AM, John SJ Anderson > wrote: > >> On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe >> wrote: >> >>> >>> >>> my $numBytesToRead = 512; >>> >>> my $buffer; >>> >>> while ($bytesRead = read($TCPSocket, $buffer, $n

Re: reading from socket

2015-08-11 Thread John SJ Anderson
On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe wrote: > > > 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 wron

Re: reading from socket

2015-08-11 Thread John SJ Anderson
On Tue, Aug 11, 2015 at 6:58 AM, John SJ Anderson wrote: > On Tue, Aug 11, 2015 at 5:24 AM, Chris Knipe wrote: > >> >> >> my $numBytesToRead = 512; >> >> my $buffer; >> >> while ($bytesRead = read($TCPSocket, $buffer, $numBytesToRead)) { >> >> if ($buffer =~ m/\r\n\.\r\n$/) { >> >> print $

Re: reading from socket

2015-08-11 Thread Brandon McCaig
Chris: On Tue, Aug 11, 2015 at 02:24:13PM +0200, Chris Knipe wrote: > Hi All, Hello, > 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 i

reading from socket

2015-08-11 Thread Chris Knipe
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 w