Article View: borland.public.cppbuilder.internet.socket
Article #595Re: BUG for TClientSocket and TClientDataSet
From: Remy Lebeau (TeamB)
Date: Fri, 30 Nov 2007 03:32
Date: Fri, 30 Nov 2007 03:32
40 lines
2213 bytes
2213 bytes
"Emmanuel" <emmanuel@erphk.com> wrote in message news:474ecbea@newsgroups.borland.com... > Whenever using a TClientSocket and TClientDataSet > (Socket Server) at the same time > eg: > > ClientSocket->Open(); > ...... > ClientDataSet->Open(); > > error must be occured > > class EvariantInvalidArgError with message 'Invalid argument' There is no way to track that down without seeing a stack trace leading up to the exception being raised. > class ESocketConnectionError with message 'Error reading form socket' That exception is only raised when the socket API recv() function does not return as many bytes as were asked for during a reading operation. Which, frankly, is really stupid on TClientDataSet's part, because that is not the proper way to handle socket data. recv() is never guaranteed to return all of the requested bytes in one call. If the return value is > 0 and more bytes are expected, recv() is supposed to be called again. But TClientDataSet does not do that. > if ClientSocket don't open, this is no error > > How can I solve it??????? Don't open them at the same time, obviously. Without knowing more about why the EVariantInvalidArgError is being raised, all I can guess is that both components are trying to use the same port at the same one, and one of them is going to fail as a result. Gambit
Technical Details
Message-ID:
<474f866c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<474ecbea@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a20543488518dffc X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <474ecbea@newsgroups.borland.com> Subject: Re: BUG for TClientSocket and TClientDataSet Date: Thu, 29 Nov 2007 19:32:24 -0800 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 75.83.29.61 Message-ID: <474f866c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1196394092 75.83.29.61 (29 Nov 2007 19:41:32 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail