🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4433

Re: Remy Could you have a look

#4433
From: Hans Galema
Date: Wed, 02 Feb 2005 22:23
39 lines
1990 bytes
mike wrote:

> Could you have a look at this code sample and see if in your opinion I am 
> approaching the problem correctly. \

Could you first tell if the code does work for you? And if not
when/where do things go wrong ?

> I would be doing this on a Non Blocking Socket.

> void __fastcall TStdPopWin::ClientSocket1Read(TObject *Sender,
> 
> TCustomWinSocket *Socket)
> 
> {
> 
> int Size, NbrBytesRead, TotalBytesToExtract, BytesToReceive, TotalBytesRead 
> ;
> 
> Size = 0 ;
> 
>  while ( true )

Do away with this while loop completely.

What do you use to copy your source code? All those extra whitelines
are annoying.

>            while ( Size > 0 )

You are never changing the value of Size. So your code
will hang here.

Apparently you want to use one OnRead event to use
ReceiveBuf for Size bytes. That is possible. But
please state such things as we then know where we
should look for.

Hans.
Technical Details
Message-ID: <42015341$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!newsfeed.kamp.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4200e6a4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8d9554d7f46a1c91
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 02 Feb 2005 23:23:52 +0100
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: Remy Could you have a look
References: <4200e6a4$1@newsgroups.borland.com>
In-Reply-To: <4200e6a4$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <42015341$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1107383105 129.125.201.248 (2 Feb 2005 14:25:05 -0800)
Lines: 39
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!newsfeed.kamp.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail