[Gambas-user] Strings and Network input ...
Gareth Bult
gareth at ...1689...
Wed May 9 15:22:55 CEST 2007
Hi,
I'm currently developing an IMAP4 client component and I seem to have run into a problem.
I'm using _Read on a Socket object when data comes in, then I'm doing;
$socket.EndOfLine = "\r\n"
LINE INPUT #$socket,buffer
Process(buffer)
Now I understand this to mean that Process() will only get called with "complete" lines.
i.e. lines that were terminated by a CRLF.
If I issue a SEARCH command against my IMAP server, I get a variable length string, and for a large folder I'm expecting a string of length 41140 to come through.
However (!) Process is being called TWICE, the first time with a string of length 41116 and the second of 24.
So it "looks like" LINE INPUT is running out of buffer space and silently splitting the string in two ... (????)
I'd rather not have to code CRLF detection for READ .. is this a bug, something fixable, or am I missing something ?
tia
Gareth.
--
Gareth Bult, Encryptec Limited
Tel: 0845 25 77033, FWD: 753977, Mob: 07891 389657
Email: gareth at ...1689...
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.
More information about the User
mailing list