wclSyncClient is available in latest WCL (6.11)
Your code looks OK but I do it other way.
TfmMain = class(TForm)
....
private
FBuffer: AnsiString; // To make it working on any Delphi/CBuilder version
end;
procedure TfmMain.wclClientConnect(Sender: TObject; Error: Integer);
begin
// Your code processes connect
....
if Error = WCL_E_SUCCESS then FBuffer := '';
end;
procedure TfmMain.wclClientData(Sender: TObject; Buffer: Pointer; Size: Cardinal);
var
s: AnsiString;
i: Integer;
begin
SetLength(s, Size);
CopyMemory(Pointer(s), Buffer, Size);
if s <> '' then begin
FBuffer := FBuffer + s;
i := Pos(#13, FBuffer);
if i > 0 then begin
s := Copy(FBuffer, 1, i - 1);
FBuffer := Copy(FBuffer, i + 1, Length(FBuffer));
meAns.Lines.Add(s);
end;
end;
end;
Something like that.