Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 27.05.05 23:43 
Hi,

ich benutze die Indy TCP Komponenten zum senden und empfangen von Dateien via Read/WriteStream...

Funktioniert auch alles wunderbar, nur kann ich es irgendwie hinbekommen beim Server einen Fortschrittsbalken zu machen...???

Beim Client ist das ja kein problem, da hat Indy den OnWork-Event... TIdTCPServer hat sowas allerdings nicht...

Hat jemand eine idee wie das gehen könnte???

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 28.05.05 00:14 
das ereignis "OnWork" hat folgende parameter:
ausblenden Delphi-Quelltext
1:
2:
3:
Sender: TObject; 
AWorkMode: TWorkMode;
AWorkCount: Integer

und jetzt zitiere ich ganz faul aus der Indy9 hilfe:
Zitat:

TWorkEvent
Unit: IdComponent
Indicates that the read or write operation is being performed.

TWorkEvent = procedure (Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer) of object;

Unit
IdComponent

Parameters
AWorkCount
Number of bytes affected by the event.
AWorkMode
The operation to be performed.
Sender
Object instance triggering the event.

Description
This event often fires when a component is receiving or sending data and this event is often used to update progress indicators.

AWorkMode indicates if the component is receiving or sending data and can be one of two values:

wmRead - The component is reading data from the peer.

wmWrite - The component is sending data to the peer.

AWorkCount indicates the number of bytes sent or received.

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 28.05.05 05:01 
Hi,

mhh... du hast anscheinend meine frage nicht ganz verstanden ;)

Wie gesagt, für den TCPClient ist das ganze mit dem onWork überhauptkein problem... allerdings besitzt der TIdTCPServer nach wie vor keinen solchen Event... daher noch immer meine frage, wie bekomme ich etwas á la onWork bei einem TIdTCPServer hin???

Au'revoir,
Aya

_________________
Aya
I aim for my endless dreams and I know they will come true!
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 28.05.05 09:16 
nimm die Simple TCP Kompo aus der OpenUnits Sparte !
da ist das super einfach !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 28.05.05 09:36 
Hi,

mhh... soweit ich die SimpleTCP Komponente kenne war das doch die wo man u.A. via Timer (o.Ä) überprüfen muß ob neue Daten angekommen sind, oder??? (zummindest seh ich auf den ersten blick keinen onExecute event oder etwas derartiges)


Aber was noch dazu kommt.. ich hab mein komplettes Programm schon auf die normalen TCP Komponenten hingebastelt, wäre extrem mühselig das alles umzustellen ;)

Gibt's da keine chance das bei dem normalen TIdTCPServer auch hinzubekommen? :(

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Sa 28.05.05 09:37 
ohh, nein. das kommt davon wenn man so spät noch fragen beantwortet ^^
ich hatte nur den ersten teil der frage gelesen :?.
mit einem server hab ich das noch nie probiert aber ich glaube mich erinnern zu können, dass das nur vonhintendurchdiebrustdurchsauge ging.

ich glaube ich hatte das mal gesehen wie das jemand via IOHandler gemacht hat.:nixweiss:
wenn ich heute nochmal zeit finde, werde ich vielleicht nochmal an deinem problem rumprobieren und nachzuvollziehen.

ich wünsche nen sonnigen tag!

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 28.05.05 09:43 
Hi,

ich glaub ich hab grad die lösung selbst gefunden :)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
begin
  AContext.Connection.OnWork:=...
end;


Hab es jetzt nochnicht getestet (werd's auch erst morgen testen, weil totmüde bin ;) ).. aber denke mal es sollte funktionieren, sieht zummindest gut aus denke ich :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!