Article View: borland.public.cppbuilder.nativeapi
Article #14843Re: BCB TCP IP component
From: Chris
Date: Fri, 01 Aug 2003 03:22
Date: Fri, 01 Aug 2003 03:22
25 lines
2143 bytes
2143 bytes
I know, I am using them, but I'm just wondering if there was already something that could help me in this situation.. I'm sending binary data. Each message's first bytes contain the size of the message. I only receive about 50k at once, so my code in OnRead is called many times. It ends the recording and processes the message after all the data it was told it was getting has been received. If it is one byte too long or short, it's fatal. Is there a way for it to be too long, and is there a way it could be too short other than the client suddenly disconnecting in the middle of the transaction, and would that cause throw an exception? I could use a timer that would count how long the socket has been idle, if all the message isn't received, I end the message, but if there is a lot messages being received it wouldn't work. Many times I send the header to the message before the rest of the message too, (this way I dont have to copy a LOT of data to a new buffer just to send it, it would be dreadfully slow), is that dangerous? I'm kinda stuck here.... Please help Thanks.
Technical Details
Message-ID:
<3f29dd02$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f29cebd$1@newsgroups.borland.com> <3f29d94d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,9e6acf8dd63da257 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-31 20:26:15 PST From: "Chris" <Chris8852@adelphia.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f29cebd$1@newsgroups.borland.com> <3f29d94d@newsgroups.borland.com> Subject: Re: BCB TCP IP component Date: Thu, 31 Jul 2003 23:22:41 -0400 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 68.65.164.124 Message-ID: <3f29dd02$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059708162 68.65.164.124 (31 Jul 2003 20:22:42 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail