Article View: borland.public.cppbuilder.internet.socket
Article #3250Re: i need ideas/comments with tclientsocket
From: Remy Lebeau (TeamB)
Date: Mon, 31 Oct 2005 19:39
Date: Mon, 31 Oct 2005 19:39
22 lines
1778 bytes
1778 bytes
"Jonathan Benedicto" <incorrect@no.server> wrote in message news:436669aa$1@newsgroups.borland.com... > SizeRead = Data->Read( &MsgSize, sizeof( int ) ); > if( SizeRead < sizeof( int ) ) > break; You are removing the length from the stream. If there are not enough bytes for the data, you have now lost the length for the next event. You should be seeking the stream backwards sizeof(int) bytes so that the same length can be re-read on the next loop. > AnsiString Message = AnsiString( (char*)( Data->Memory + > Data->Position ), MsgSize ); The Memory property is declared as a void*. You cannot add the Position to the Memory as-is. You have to cast the Memory first, such as to BYTE* or char*. Gambit
Technical Details
Message-ID:
<436672f9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.xsnews.nl!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43662baf$1@newsgroups.borland.com> <43664511@newsgroups.borland.com> <4366672a$1@newsgroups.borland.com> <436669aa$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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <43662baf$1@newsgroups.borland.com> <43664511@newsgroups.borland.com> <4366672a$1@newsgroups.borland.com> <436669aa$1@newsgroups.borland.com> Subject: Re: i need ideas/comments with tclientsocket Date: Mon, 31 Oct 2005 11:39:39 -0800 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <436672f9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130787577 68.69.17.41 (31 Oct 2005 11:39:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.xsnews.nl!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail