🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: i need ideas/comments with tclientsocket

#3254
From: Hans Galema
Date: Mon, 31 Oct 2005 20:52
28 lines
2097 bytes
Alfred wrote:

> here is my new problem , for example : the first time I get only the first part of 
 > a package and after few seconds I get the last part of this  package. How I can
 > oin both parts ? my code now works but I haven't a single message, i have a lot of splitted message.

Please keep wrapping your lines als at the end of a message.

How to concatenate I already told in one of the first replies to Jonathan:

And you do not need an extra buffer. Put it in the stream directly.

   int receivelength = Socket->ReceiveLength();

   if ( receivelength <= 0 )
       return;

   if ( MemoryStream->Position + receivelength >= MemoryStream->Size )
      MemoryStream->Size += receivelength + 1; // +1 is not needed I think

   int nread = Socket->ReceiveBuf (
     ((char*)MemoryStream->Memory) + MemoryStream->Position, receivelength );

   MemoryStream->Position += nread;

Now check the stream for a complete message and so.

Hans.
Technical Details
Message-ID: <43668460@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43662baf$1@newsgroups.borland.com> <43664511@newsgroups.borland.com> <4366672a$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
Date: Mon, 31 Oct 2005 21:52:42 +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: i need ideas/comments  with tclientsocket
References: <43662baf$1@newsgroups.borland.com> <43664511@newsgroups.borland.com> <4366672a$1@newsgroups.borland.com>
In-Reply-To: <4366672a$1@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: <43668460@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1130792032 145.98.201.248 (31 Oct 2005 12:53:52 -0700)
Lines: 28
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail