Article View: borland.public.cppbuilder.internet.socket
Article #4435Re: Remy Could you have a look
From: mike
Date: Thu, 03 Feb 2005 23:23
Date: Thu, 03 Feb 2005 23:23
56 lines
2445 bytes
2445 bytes
Thank you both for the information.
Hans, unfortunately I used wordpad for this post of sample code. After I
posted I noticed the way it formatted and won't be doing that again. I
aggree, it was extremly annoying. Sorry.
Ok so now I need to have a look at the code kindly posted by Remy and try to
understand it.
Thank you both again.
Mike
"Hans Galema" <notused@notused.nl> wrote in message
news:42015341$1@newsgroups.borland.com...
> 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:
<420161eb@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4200e6a4$1@newsgroups.borland.com> <42015341$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 From: "mike" <mfbrowne@earthlink.nnet> Newsgroups: borland.public.cppbuilder.internet.socket References: <4200e6a4$1@newsgroups.borland.com> <42015341$1@newsgroups.borland.com> Subject: Re: Remy Could you have a look Date: Thu, 3 Feb 2005 18:23:03 -0500 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 68.204.189.169 Message-ID: <420161eb@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1107386859 68.204.189.169 (2 Feb 2005 15:27:39 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail