Article View: borland.public.cppbuilder.internet.socket
Article #5569Re: I need some suggestions and oppinion for sending data
From: Daniele Borini
Date: Sun, 08 Aug 2004 02:14
Date: Sun, 08 Aug 2004 02:14
69 lines
3448 bytes
3448 bytes
hi, i think you should send data as string. sending rows one by one, you'll receive rows one by one, if you use TCP (not UDP) it's not your problem to rebuild and reorder received data, it's a TCP stuff to ensure packets "chunk" rebuild. by sending rows one by one you just need to something like: 1@1 X YYYYYYYY ZZZZZZZZZZZZZZZZ@ 2@1 QQQQQQQQ WWWWWWWWWWWWWWWWWW@ first character indicates what kind of schema will follow between two '@' characters. the rest it's just a simple string parser... 'bout speed there aren't sure numbers, just make some tests: try to send a very large amount of data, every second test how many byte (or MByte) has been sent then calculate the average value, by this way you'll always have a good estimation of network speed and transfer times... Good luck Daniele > Hi, > > I have 4 data structures to be sent from one service > to the other via TClientSocket & TServerSocket. Those > structures are fragments of database. > > Struct 1 schema (Columns=4; Rows=Struct1->Count ) > > 1 X YYYYYYYYYY ZZZZZZZZZZZZZZZZZ > 2 X YYYYYYYYYY ZZZZZZZZZZZZZZZZZ > 3 X YYYYYYYYYY ZZZZZZZZZZZZZZZZZ > (Y and Z are not with fixed filed length) > > Struct 2, 3 & 4 schema (Columns=3, Rows=StructN->Count ) > > 1 QQQQQQ WWWWWWWWWWWWWWWWWWW > 2 QQQQQQ WWWWWWWWWWWWWWWWWWW > (Q and W are not with fixed filed length) > > > I have two questions: > > 1) How could I send those data? I think I should > first make one specialy formated buffer which I > should transfer in the usual manner (in fragments) > and on the server side (when all received) to use > the same algorythm to decrypt data to the same > structures. > > In such situations I usually made some special marks > which I can later used to separate entities like: > > [$S1$] 1 [$S1$] X [$S1$] YYY... [$S1$] ZZZ... > [$S2$] 1 [$S2$] QQQQQ... [$S2$] WWW... > > ... in short - [$S1$] means that the data belongs to the > first struct and because there are 4 columns in struct1 > there is no ned for the special mark for the end of row. > > Can you suggest me something easier and better? > > 2) If there are 100 rows (in all 4 structures), and > not more than 100 chars in a row, how much time will > take sending data in 100 MBit LAN that has not much > traffic. > > > Best regards, > Vladimir Stefanovic > > >
Technical Details
Message-ID:
<41158ca0@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!newshosting.com!nx02.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<41152fcb@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,9e55e8bf383b51eb X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 08 Aug 2004 04:14:49 +0200 From: Daniele Borini <borini@infinito.it> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: I need some suggestions and oppinion for sending data References: <41152fcb@newsgroups.borland.com> In-Reply-To: <41152fcb@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 62.94.66.242 Message-ID: <41158ca0@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1091931296 62.94.66.242 (7 Aug 2004 19:14:56 -0700) Lines: 69 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!newshosting.com!nx02.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail