Article View: borland.public.cppbuilder.internet.socket
Article #3234Re: i need ideas/comments with tclientsocket
From: Jonathan Benedicto
Date: Mon, 31 Oct 2005 16:13
Date: Mon, 31 Oct 2005 16:13
22 lines
1911 bytes
1911 bytes
Hans Galema wrote: > If receivelength() > then Data->Length then your code will not read > all available bytes. Your code has to do that though otherwise your > program will hang. Why will it do that ? > You don't need to declare a temporary buffer. Just receive directly > in the TMemoryStream and care for a sufficient Size: Thank you for that improvement. > If you check for Data->Length == 0 then you are not allowing the > sender to send more than one message at a time. If the sender sends more > messages at once than the second message can have partly come in with > the first message. Better check if a complete message came in. > You then cannot automatically clear the stream also because of a next > message already partly present. Thank you, I hadn't thought of that. I'll fix it. Jonathan
Technical Details
Message-ID:
<436642bd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43662baf$1@newsgroups.borland.com> <43663272$1@newsgroups.borland.com> <43664213$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5c33b8c6a9ca7fdb X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Jonathan Benedicto" <incorrect@no.server> Newsgroups: borland.public.cppbuilder.internet.socket References: <43662baf$1@newsgroups.borland.com> <43663272$1@newsgroups.borland.com> <43664213$1@newsgroups.borland.com> Subject: Re: i need ideas/comments with tclientsocket Date: Mon, 31 Oct 2005 11:13:56 -0500 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 69.158.116.150 Message-ID: <436642bd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130775229 69.158.116.150 (31 Oct 2005 08:13:49 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail