BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TCP Client / Server

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Margreiter
Guest





PostPosted: Sat Jan 14, 2006 11:31 am    Post subject: TCP Client / Server Reply with quote



Hi,
I send files form a TCPClient to a TCPServer.

Client:
TCPClient->WriteStream(strm, true, true, strm->Size);

How can I get informations about status of transmition,
where can I read out how many bytes transmitted??

Thank you for help!
Johann


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Jan 17, 2006 8:03 pm    Post subject: Re: TCP Client / Server Reply with quote




"Margreiter" <ma (AT) soft-hard-ware (DOT) at> wrote


Quote:
How can I get informations about status of transmition,
where can I read out how many bytes transmitted??

Use the OnWork... events.


Gambit



Back to top
Margreiter
Guest





PostPosted: Thu Jan 19, 2006 8:15 am    Post subject: Re: TCP Client / Server Reply with quote



Quote:
Use the OnWork... events.

I tried this already, but this event is never fired.
Are there some preparations necessary?


Johann



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Jan 19, 2006 8:30 am    Post subject: Re: TCP Client / Server Reply with quote


"Margreiter" <ma (AT) soft-hard-ware (DOT) at> wrote


Quote:
I tried this already

Please show your actual code.

Quote:
but this event is never fired.

Yes, they are.


Gambit



Back to top
Margreiter
Guest





PostPosted: Thu Jan 19, 2006 10:13 am    Post subject: Re: TCP Client / Server Reply with quote

Quote:
I tried this already

Please show your actual code.


transmitting large files may take a long time, so I want to install a simple
indicator, how many bytes are transfered.
try
{
TMemoryStream* strm = new TMemoryStream;
.....
Form1->TCPDataClient->Host = IPAdr;
Form1->TCPDataClient->Connect();

strm->LoadFromFile(SPath);
Form1->TCPDataClient->WriteStream(strm, true, true, strm->Size);
.....
}
Quote:
but this event is never fired.

Yes, they are.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Jan 19, 2006 5:55 pm    Post subject: Re: TCP Client / Server Reply with quote


"Margreiter" <ma (AT) soft-hard-ware (DOT) at> wrote


Quote:
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.

Quote:
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



Back to top
Margreiter
Guest





PostPosted: Sun Jan 22, 2006 4:22 pm    Post subject: Re: TCP Client / Server Reply with quote

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

I tried to get the information in th OnWork event:
void __fastcall TForm1::TCPDataClientWork(TObject *Sender,
TWorkMode AWorkMode, const int AWorkCount)
{
StatusBar1->SimpleText = AnsiString(AWorkCount);
}
but this event is never fired.
Do I have to assign or to initialize these events somewhere earlier?



Quote:
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);
...

I did not realize this function.

thank you
Johann



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Jan 23, 2006 7:37 am    Post subject: Re: TCP Client / Server Reply with quote


"Margreiter" <ma (AT) soft-hard-ware (DOT) at> wrote


Quote:
I tried to get the information in th OnWork event:

You are not differentiating between reading and writing activities. You
should be looking at the AWorkMode parameter before processing the
AWorkCount parameter.

Quote:
this event is never fired.

I can guarantee to you that is is ALWAYS triggered. If it is not, then you
have a buggy version of Indy. Which EXACT version of Indy are you actually
using?


Gambit



Back to top
Margreiter
Guest





PostPosted: Mon Jan 23, 2006 4:21 pm    Post subject: Re: TCP Client / Server Reply with quote

Quote:

I can guarantee to you that is is ALWAYS triggered. If it is not, then
you
have a buggy version of Indy. Which EXACT version of Indy are you
actually
using?

I am using version 9_00_17


Johann



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Jan 23, 2006 5:35 pm    Post subject: Re: TCP Client / Server Reply with quote


"Margreiter" <ma (AT) soft-hard-ware (DOT) at> wrote


Quote:
I am using version 9_00_17

That is an old build. The current Development Snapshot is 9.0.50. You
should consider upgrading, and see if the problem still persists.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.