Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi "no data to send" bei indy 10 tcp (https://www.delphipraxis.net/48659-no-data-send-bei-indy-10-tcp.html)

prinz_inzide 28. Jun 2005 17:01


"no data to send" bei indy 10 tcp
 
hi!

habe folgenden code:
Delphi-Quellcode:
procedure TForm1.Button3Click(Sender: TObject);
var
  fs: tfilestream;
  ms:tmemorystream;
  ilast:int64;
  inext:integer;
  stream: tidstreamvcl;
begin
fs:= tfilestream.Create('c:\katze1.jpg',fmopenread);
ms:= tmemorystream.Create;
ilast:=0;
while (ilast < fs.Size) do begin
  inext:= fs.Size-ilast;
  if inext > 10000 then
    inext:=10000;
  fs.Position:=ilast;
  ms.CopyFrom(fs,inext);
  try
  stream:= tidstreamvcl.Create(ms);
  memo1.lines.add('infos '+inttostr(ilast)+' '+inttostr(stream.Size)+' '+inttostr(ms.size));
  finally
  client.Socket.WriteBufferOpen;
  //sleep(50);
  client.Socket.Write(stream,stream.size,true);
  //sleep(50);
  client.Socket.WriteBufferClose;
  //client.Socket.WriteBuffercancel;
  stream.free;
  ilast:=ilast+inext;
  end;
end;
ms.Free;
fs.free;
end;
da bekomm ich nach(!) den ersten 10000 verschickten bytes einen "EIdNoDataToSend"..

hat eienr ne ahnung, was daran falsch ist?

danke!!


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:32 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz