Autor Beitrag
unstable
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

windows xp/2000
D5
BeitragVerfasst: Di 05.10.04 12:31 
yo,

ich bin eine datei am downloaden.
während ich download kriege ich von einem anderen programm über eine socketverbindung ein string.
kurz darauf den nächsten.
díe beide kommen während ich am downloaden bin.
wenn der download fertig ist, kommt der erste string noch an, aber der 2e nicht.
kann man die strings irgendwie abfangen???
oder was mache ich falsch...

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TDownload.ServerSocket1ClientRead(Sender: TObject;
  Socket: TCustomWinSocket);
var
  i:integer;
  sRec : string;
begin
  for i := 0 to ServerSocket1.Socket.ActiveConnections-1 do
  begin
    with ServerSocket1.Socket.Connections[i] do
    begin
      sRec := ReceiveText;
      if sRec <> '' then
      begin
        DownloadList.Add(sRec);
       //den timer für den download starten
       FTimer.Enabled := true;
      end;
    end;
  end;
end;


der timer startet alle paar sekunden einen neuen download.

_________________
why bother with a sig?
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 05.10.04 12:39 
Die Daten pappen sehr wahrscheinlich aneinander, und wenn in dem einen String ein #0 vorkommt, siehst du das dahinter nicht mehr.

Schau mal hier, da wurde das auch besprochen.

Diese Komponenten lösen das Problem sofort.

Cu,
Udontknow
unstable Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

windows xp/2000
D5
BeitragVerfasst: Di 05.10.04 12:56 
yo,

du hast recht, die daten kleben an einander, in einen string.

nächstes problem:
ich verstehe das mit der länge des strings nicht so ganz.....
wie ich das auslesen muss.

irgendwo im string habe <text>blah</text> stehen.
in diesem fall so gar öfters.
es geht um das wort blah, das zwischen den xml tags steht.
den ersten auszulesen ist kein problem.
aber wie kann ich zählen das da mehrere tags sind?
und wie könnte ich den auslesen?

plz help,
unstable

EDIT: ich habe schon eine lösung für das problem, aber danke für die hilfe :)

_________________
why bother with a sig?


Zuletzt bearbeitet von unstable am Di 05.10.04 13:28, insgesamt 1-mal bearbeitet
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 05.10.04 13:05 
Bitte neuen Thread, das hat nichts mit Internet/Netzwerk zu tun.

Cu,
Udontknow