Can it be to have trial components installed yet?
I post the code is the event of idTCPServer OnExecute.
Code: Select all
procedure TForm4.IdTCPServer1Execute(AContext: TIdContext);
var
Bloques: integer;
i: integer;
TamanoBloque: integer;
trozoTexto: ansistring;
texto: ansistring;
ack: TdiACK_25;
begin
TamanoBloque := 1024;
// Receive
Bloques := StrToInt(AContext.Connection.IOHandler.ReadLn);
texto := '';
for i := 0 to Bloques do
texto := texto + AContext.Connection.IOHandler.ReadLn;
texto := MimeDecodeString(texto);
//Result := texto;
memo1.lines.add(texto);
// Send
ack := TdiACK_25.Create;
try
////////////////////////////
texto := ack.AsXML; // I GET ERROR HERE (with "ack.AsString" Too)
////////////////////////////
texto := MimeEncodeStringNoCRLF(texto);
Bloques := Length(texto) div TamanoBloque;
AContext.Connection.IOHandler.writeln(IntToStr(Bloques));
for i := 0 to Bloques do
begin
trozoTexto := ansistrings.AnsiMidStr(texto, (TamanoBloque * i) + 1, TamanoBloque);
AContext.Connection.IOHandler.writeln(trozoTexto);
end;
finally
freeandnil(ack);
end;
end;