Article View: borland.public.cppbuilder.internet.socket
Article #490Re: Indy10 usage
From: Mike Ruskai
Date: Wed, 05 Mar 2008 04:18
Date: Wed, 05 Mar 2008 04:18
24 lines
1835 bytes
1835 bytes
On or about Tue, 04 Mar 2008 22:04:47 -0500 did Mike Ruskai
<BUTthannydI@DONTearthlinkLIKE.netSPAM> dribble thusly:
>> IOHandler->[CheckForDataOnSource(10)];
>> IOHandler->ReadBytes(buffer, min(1024, IOHandler->InputBuffer->Size));
Just discovered something rather bizarre about this. ReadBytes()
throws an EIdConnClosedGracefully when the socket has been closed by
the remote after all data had been sent.
And it fails to read the data remaining in the input buffer.
So, I have to do something like this to read all data:
try
{
sock->IOHandler->ReadBytes(buf, bufsize, false);
}
catch (EIdConnClosedGracefully)
{
sock->IOHandler->InputBuffer->ExtractToBytes(buf);
}
This is not a developer-friendly library.
Technical Details
Message-ID:
<ch7ss31acm13alsqj2s3utjhnbusnks1a9@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<ghsqs35tipni65rjlntjpl7hgi6f1bv1g8@4ax.com> <47cd89bb$1@newsgroups.borland.com> <tefrs3lpnfkk0arr2qa3vospikaj3j491h@4ax.com> <47cdc920@newsgroups.borland.com> <tu0ss39uaq8j35if50r88eflpsf5nvs431@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ea086d952e8cb041 X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Mike Ruskai <BUTthannydI@DONTearthlinkLIKE.netSPAM> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Indy10 usage Date: Tue, 04 Mar 2008 23:18:15 -0500 Message-ID: <ch7ss31acm13alsqj2s3utjhnbusnks1a9@4ax.com> References: <ghsqs35tipni65rjlntjpl7hgi6f1bv1g8@4ax.com> <47cd89bb$1@newsgroups.borland.com> <tefrs3lpnfkk0arr2qa3vospikaj3j491h@4ax.com> <47cdc920@newsgroups.borland.com> <tu0ss39uaq8j35if50r88eflpsf5nvs431@4ax.com> X-Newsreader: Forte Agent 4.2/32.1118 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 65.41.244.203 X-Trace: newsgroups.borland.com 1204690690 65.41.244.203 (4 Mar 2008 20:18:10 -0700) Lines: 24 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 1691