http://lnet.wordpress.com/usage/sockets ... d-sending/
Und bitte eine Beispielfunktion für GetNewChunk.procedure TMyClass.OnCanSend(aSocket: TLSocket);
var
Sent: Integer; // number of bytes sent each try
TempBuffer: string = ''; // our local temp. buffer for the filestream, can be done smarter tho
begin
repeat
if Length(TempBuffer) = 0 then
TempBuffer := GetNewChunk; // get next chunk if we sent all from the last one
Sent := FConnection.SendMessage(TempBuffer, aSocket); // remember, don't use the aSocket directly!
Delete(TempBuffer, 1, Sent); // delete all we sent from our temporary buffer!
until (Sent = 0) or (AllIsSent); // try to send until you can't send anymore
end;
Das habe ich mir gedacht:
Code: Alles auswählen
var data: string;
function GetNewChunk: string;
begin
result := copy(data, 1, 65535);
delete(data, 1, 65535);
end;
mfg _X_