🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TCP Client / Server

#2819
From: Remy Lebeau (TeamB)
Date: Thu, 19 Jan 2006 17:55
23 lines
1840 bytes
"Margreiter" <ma@soft-hard-ware.at> wrote in message
news:43cf64ce$1@newsgroups.borland.com...

> transmitting large files may take a long time, so I want to
> install a simple indicator, how many bytes are transfered.

That is what the OnWork events are for.  But you did not show where they are
being assigned, or what their code looks like.

>        TMemoryStream* strm = new TMemoryStream;

Why are you loading the entire file into memory before sending it?  If you
use a TFileStream instead, then you can send the file directly

    TFileStream* strm = new TFileStream(SPath, fmOpenRead |
fmShareDenyWrite);
    ...
    Form1->TCPDataClient->WriteStream(strm, true, true, 0);
    ...


Gambit
Technical Details
Message-ID: <43cfd1f5$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43c8dfc3@newsgroups.borland.com> <43cd4ccc$1@newsgroups.borland.com> <43cf4937@newsgroups.borland.com> <43cf5359$1@newsgroups.borland.com> <43cf64ce$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c2aaeb47b5011605
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: <43c8dfc3@newsgroups.borland.com> <43cd4ccc$1@newsgroups.borland.com> <43cf4937@newsgroups.borland.com> <43cf5359$1@newsgroups.borland.com> <43cf64ce$1@newsgroups.borland.com>
Subject: Re: TCP Client / Server
Date: Thu, 19 Jan 2006 09:55:39 -0800
Lines: 25
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: <43cfd1f5$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1137693173 68.69.17.41 (19 Jan 2006 09:52:53 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail