So ich habs ma probiert umzusetzen:
hier der client:
Delphi-Quellcode:
procedure TForm1.sendStream(pic:TBitmap);
var MStream:TMemoryStream;
data:string;
begin
MStream:=TMemoryStream.Create;
CompressBitmap(pic,data);
try
MStream.WriteBuffer(data,Length(Data));
MStream.Position:=0;
try
IdTCPClient1.Socket.Write(MStream,0,true);
except
end;
finally
MStream.Free;
end;
end;
hier der server:
Delphi-Quellcode:
procedure TForm2.IdTCPServer1Execute(AContext: TIdContext);
var data:string;
FStream:TMemoryStream;
bmp:TBitmap;
begin
FStream:=TMemoryStream.Create;
try
AContext.Connection.Socket.ReadStream(FStream);
FStream.Position:=0;
finally
try
FStream.Read(data,1000000);
finally
//bmp.LoadFromStream(FStream);
FStream.Free;
end;
end;
UnCompressBitmap(data,bmp);
end;
sooo der client schickt anscheinend was, zumindest ist data gefüllt
beim server kommt Connection closed Gracefully.