Article View: borland.public.cppbuilder.internet.socket
Article #3376Re: TServerSocket sends a unwanted acknowlege
From: Hans Galema
Date: Wed, 21 Sep 2005 12:37
Date: Wed, 21 Sep 2005 12:37
19 lines
1707 bytes
1707 bytes
Billy Holliday wrote:
> ServerSocketClientRead( TObject *Sender, TCustomWinSocket *Socket )
> {
> count = Socket->ReceiveLength (); // checking how much bytes received
> unsigned char Buff[5000]; // make a big buffer
> Socket->ReceiveBuf ( Buff, count ); // read the data
>
> // processing the data..
How big are the messages that come from the client ?
Are they that small that they come with only one readevent ?
Do you check that a whole message came in ?
As first statement add:
if ( Socket->ReceiveLength() < 1 ) return;
Hans.
Technical Details
Message-ID:
<433153b9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feed6.newsreader.com!newsreader.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<433101e8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2e35895317a3987d X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 21 Sep 2005 14:37:11 +0200 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: TServerSocket sends a unwanted acknowlege References: <433101e8@newsgroups.borland.com> In-Reply-To: <433101e8@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 145.98.201.248 Message-ID: <433153b9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1127306169 145.98.201.248 (21 Sep 2005 05:36:09 -0700) Lines: 19 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feed6.newsreader.com!newsreader.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail